Click here to Skip to main content
16,006,452 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: DataGrid Record Loop. Pin
Smokeywade22-Aug-07 9:49
Smokeywade22-Aug-07 9:49 
GeneralRe: DataGrid Record Loop. Pin
jchigg200022-Aug-07 10:14
jchigg200022-Aug-07 10:14 
GeneralRe: DataGrid Record Loop. Pin
Smokeywade22-Aug-07 10:38
Smokeywade22-Aug-07 10:38 
GeneralRe: DataGrid Record Loop. Pin
Johan Hakkesteegt23-Aug-07 2:06
Johan Hakkesteegt23-Aug-07 2:06 
GeneralRe: DataGrid Record Loop. Pin
Smokeywade23-Aug-07 4:10
Smokeywade23-Aug-07 4:10 
QuestionRe: DataGrid Record Loop. Pin
Smokeywade23-Aug-07 10:00
Smokeywade23-Aug-07 10:00 
AnswerRe: DataGrid Record Loop. Pin
Johan Hakkesteegt28-Aug-07 21:35
Johan Hakkesteegt28-Aug-07 21:35 
QuestionCross-thread operation not valid. Please plz Help Pin
TechPrince22-Aug-07 8:07
TechPrince22-Aug-07 8:07 
I am creating an application in which there is a Button and a ListView Control.
I am using VB2005.
The Subroutine below just copies the listviewitem's and subitem's text.

Controls: A button named "Search" and a listview with CheckBoxes property enabled named "lv1"

But the error comes:
System.InvalidOperationException was unhandled
Message="Cross-thread operation not valid: Control 'lv1' accessed from a thread other than the thread it was created on."


I know i have to use Delegate to Marshall Call. But i am not getting it properly.

Here is the Problem Code:
Private Sub startsearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startsearch.Click<br />
Dim trd As Thread<br />
trd = New Thread(AddressOf Me.Search)<br />
trd.Start()<br />
End Sub<br />
<br />
Private Sub Search()<br />
Dim i As Integer<br />
<br />
For i = 0 To lv1.Items.Count - 1<br />
<br />
If (lv1.Items.Item(i).Checked = False) Then 'Error Comes here<br />
Debug.Write("Checked=True")<br />
Else<br />
GoTo increase<br />
End If<br />
<br />
Dim a as String = lv1.Items.Item(i).SubItems.Item(1).Text 'Here<br />
Dim b as String = lv1.Items.Item(i).SubItems.Item(2).Text 'Here<br />
Dim c as String = lv1.Items.Item(i).SubItems.Item(3).Text 'Here<br />
<br />
increase:<br />
              Next i<br />
End Sub<br />

Can anyone plz give me the corrected code for the above?????
AnswerRe: Cross-thread operation not valid. Please plz Help Pin
Dave Kreskowiak23-Aug-07 3:23
mveDave Kreskowiak23-Aug-07 3:23 
QuestionHow associate different event handler at runtime Pin
Amer Rehman22-Aug-07 7:25
Amer Rehman22-Aug-07 7:25 
AnswerRe: How associate different event handler at runtime Pin
kubben22-Aug-07 8:34
kubben22-Aug-07 8:34 
AnswerRe: How associate different event handler at runtime Pin
Luc Pattyn22-Aug-07 14:19
sitebuilderLuc Pattyn22-Aug-07 14:19 
QuestionMultidimension arrays and gridview Pin
shrihit22-Aug-07 6:55
shrihit22-Aug-07 6:55 
AnswerRe: Multidimension arrays and gridview Pin
San@Coding22-Aug-07 17:40
San@Coding22-Aug-07 17:40 
AnswerRe: Multidimension arrays and gridview Pin
San@Coding22-Aug-07 17:44
San@Coding22-Aug-07 17:44 
QuestionBatch Crystal Reports Pin
ryan11722-Aug-07 6:36
ryan11722-Aug-07 6:36 
QuestionDraging a control within a control on windows form Pin
BooleanTrue22-Aug-07 5:29
professionalBooleanTrue22-Aug-07 5:29 
AnswerRe: Draging a control within a control on windows form Pin
Christian Graus22-Aug-07 12:56
protectorChristian Graus22-Aug-07 12:56 
GeneralRe: Draging a control within a control on windows form Pin
BooleanTrue23-Aug-07 0:48
professionalBooleanTrue23-Aug-07 0:48 
Questionshell command problems Pin
plural22-Aug-07 5:23
plural22-Aug-07 5:23 
AnswerRe: shell command problems Pin
Craster22-Aug-07 5:56
Craster22-Aug-07 5:56 
GeneralRe: shell command problems Pin
plural22-Aug-07 6:22
plural22-Aug-07 6:22 
QuestionWeb Services Pin
susheel7422-Aug-07 5:17
susheel7422-Aug-07 5:17 
AnswerRe: Web Services [modified] Pin
nlarson1122-Aug-07 11:24
nlarson1122-Aug-07 11:24 
QuestionFileStream.Write doing odd things... Pin
andycee22-Aug-07 4:22
andycee22-Aug-07 4:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.