Click here to Skip to main content
16,014,650 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Tracking Tab Key Press in DataGridView Pin
Dave Kreskowiak17-Oct-07 2:03
mveDave Kreskowiak17-Oct-07 2:03 
GeneralRe: Tracking Tab Key Press in DataGridView Pin
Salman Sheikh17-Oct-07 22:46
Salman Sheikh17-Oct-07 22:46 
GeneralRe: Tracking Tab Key Press in DataGridView Pin
SekharOne17-Oct-07 23:48
SekharOne17-Oct-07 23:48 
GeneralRe: Tracking Tab Key Press in DataGridView Pin
Dave Kreskowiak18-Oct-07 2:07
mveDave Kreskowiak18-Oct-07 2:07 
QuestionTextBox Problem Pin
MikeMarq16-Oct-07 16:40
MikeMarq16-Oct-07 16:40 
AnswerRe: TextBox Problem Pin
Christian Graus16-Oct-07 18:27
protectorChristian Graus16-Oct-07 18:27 
GeneralRe: TextBox Problem Pin
MikeMarq16-Oct-07 18:48
MikeMarq16-Oct-07 18:48 
GeneralRe: TextBox Problem Pin
Dave Kreskowiak17-Oct-07 1:57
mveDave Kreskowiak17-Oct-07 1:57 
It applies to every control. You cannot modify a control from a thread other than the one that created the control.

Christian is correct, this should have exploded when the code got to updating the control. This tells me that either you've set that nasty little property called "CheckForIllegalCrossThreadCalls" to False, or you're wrapped the code that updates the checkbox in a Try/Catch block that's eating the exception that gets thrown.

You have to provide a method on your form to update the TextBox, create a delegate for it, then you Invoke that method to update the TextBox. From memory, it goes something like this:
Public Class Form1
 
    Private Delegate Sub UpdateTextBoxDelegate(ByVal message As String)
 
    Public Sub UpdateTextBox(ByVal message As String)
        If TextBox1.InvokeRequired Then
            TextBox1.Invoke(New UpdateTextBoxDelegate(AddressOf UpdateTextBox), New Object() {message})
        Else
            TextBox1.Text = message
        End If
    End Sub

This sub can be called from from code on the form running from any thread and the call will get marshaled back to the UI thread to update the textbox. All you have to do is call the sub:
UpdateTextBox("Some string...")






A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


QuestionExecute SQL Server Report Service from VB6 Pin
QPun16-Oct-07 15:40
QPun16-Oct-07 15:40 
AnswerRe: Execute SQL Server Report Service from VB6 Pin
Vimalsoft(Pty) Ltd17-Oct-07 5:35
professionalVimalsoft(Pty) Ltd17-Oct-07 5:35 
GeneralRe: Execute SQL Server Report Service from VB6 Pin
QPun17-Oct-07 16:30
QPun17-Oct-07 16:30 
GeneralRe: Execute SQL Server Report Service from VB6 Pin
Vimalsoft(Pty) Ltd17-Oct-07 20:02
professionalVimalsoft(Pty) Ltd17-Oct-07 20:02 
QuestionI need a good vb.net 2005 book Pin
imonfiredammit16-Oct-07 9:46
imonfiredammit16-Oct-07 9:46 
AnswerRe: I need a good vb.net 2005 book Pin
Christian Graus16-Oct-07 10:08
protectorChristian Graus16-Oct-07 10:08 
Questionpassing data between open forms Pin
KimHeylen16-Oct-07 8:49
KimHeylen16-Oct-07 8:49 
AnswerRe: passing data between open forms Pin
DigiOz Multimedia16-Oct-07 9:12
DigiOz Multimedia16-Oct-07 9:12 
GeneralRe: passing data between open forms Pin
KimHeylen16-Oct-07 9:50
KimHeylen16-Oct-07 9:50 
AnswerRe: passing data between open forms Pin
Christian Graus16-Oct-07 10:12
protectorChristian Graus16-Oct-07 10:12 
QuestionDot Net Remoting Pin
PJ_1234516-Oct-07 5:51
PJ_1234516-Oct-07 5:51 
AnswerRe: Dot Net Remoting Pin
Dave Kreskowiak16-Oct-07 6:14
mveDave Kreskowiak16-Oct-07 6:14 
GeneralRe: Dot Net Remoting Pin
PJ_1234516-Oct-07 20:44
PJ_1234516-Oct-07 20:44 
GeneralRe: Dot Net Remoting Pin
Dave Kreskowiak17-Oct-07 2:07
mveDave Kreskowiak17-Oct-07 2:07 
GeneralRe: Dot Net Remoting Pin
PJ_1234517-Oct-07 2:32
PJ_1234517-Oct-07 2:32 
GeneralRe: Dot Net Remoting Pin
PJ_1234517-Oct-07 3:17
PJ_1234517-Oct-07 3:17 
GeneralRe: Dot Net Remoting Pin
Dave Kreskowiak17-Oct-07 4:25
mveDave Kreskowiak17-Oct-07 4:25 

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.