Click here to Skip to main content
16,004,991 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Christian Graus7-Jun-09 0:09
protectorChristian Graus7-Jun-09 0:09 
GeneralRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Graham Irons7-Jun-09 1:29
Graham Irons7-Jun-09 1:29 
GeneralRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Mycroft Holmes7-Jun-09 3:09
professionalMycroft Holmes7-Jun-09 3:09 
GeneralRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Graham Irons7-Jun-09 12:58
Graham Irons7-Jun-09 12:58 
GeneralRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Mycroft Holmes7-Jun-09 14:14
professionalMycroft Holmes7-Jun-09 14:14 
GeneralRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Graham Irons7-Jun-09 16:52
Graham Irons7-Jun-09 16:52 
QuestionIs it possible to create controls from a new thread in a multithreading windows form application Pin
Amer Rehman6-Jun-09 21:31
Amer Rehman6-Jun-09 21:31 
AnswerRe: Is it possible to create controls from a new thread in a multithreading windows form application Pin
Moreno Airoldi7-Jun-09 1:30
Moreno Airoldi7-Jun-09 1:30 
You must use Invoke to call a routine which will then be in the UI thread.
For example:

VB
Dim dataStorage As String

Private Sub SystemRepliedEventHandler(ByVal data As String) Handles tcpSend.SystemReplied

    'MsgBox(data)
    'create the controls to display data
    'this doesn't work
    'Dim type As New TextBox
    'type.Location = New Point(100, 100)
    'type.Size = New Size(100, 100)
    'type.Text = data
    'Controls.Add(type)

    dataStorage = data
    Invoke(New MethodInvoker(AddressOf MyAddControl))

End Sub

Private Sub MyAddControl()

    Dim type As New TextBox
    type.Location = New Point(100, 100)
    type.Size = New Size(100, 100)
    type.Text = dataStorage
    Controls.Add(type)

End Sub


You can think of a more elegant way of passing over data and such, but basically this is what you need.

It may be also interesting to consider the InvokeRequired method, which will return true if you are on a different thread than the UI. It can be useful when you need to know if you need to use Invoke. In your case it's perfectly safe to always use Invoke, but you can also change your code this way:

VB
Private Sub SystemRepliedEventHandler(ByVal data As String) Handles tcpSend.SystemReplied

    dataStorage = data
    If (InvokeRequired) Then
        Invoke(New MethodInvoker(AddressOf MyAddControl))
    Else
        MyAddControl()
    End If

End Sub


Hope this will be of help. Smile | :)

2+2=5 for very large amounts of 2
(always loved that one hehe!)

AnswerRe: Is it possible to create controls from a new thread in a multithreading windows form application Pin
Dave Kreskowiak7-Jun-09 7:18
mveDave Kreskowiak7-Jun-09 7:18 
Questionimage loop in vb.net Pin
bapu28896-Jun-09 11:56
bapu28896-Jun-09 11:56 
AnswerRe: image loop in vb.net Pin
Alan N6-Jun-09 12:23
Alan N6-Jun-09 12:23 
QuestionRe: image loop in vb.net Pin
bapu28896-Jun-09 23:21
bapu28896-Jun-09 23:21 
AnswerRe: image loop in vb.net Pin
Alan N7-Jun-09 0:34
Alan N7-Jun-09 0:34 
AnswerRe: image loop in vb.net Pin
0x3c06-Jun-09 23:36
0x3c06-Jun-09 23:36 
QuestionRe: image loop in vb.net Pin
bapu28897-Jun-09 0:20
bapu28897-Jun-09 0:20 
AnswerRe: image loop in vb.net Pin
riced7-Jun-09 0:51
riced7-Jun-09 0:51 
GeneralRe: image loop in vb.net Pin
Henry Minute7-Jun-09 1:05
Henry Minute7-Jun-09 1:05 
GeneralRe: image loop in vb.net Pin
riced7-Jun-09 1:14
riced7-Jun-09 1:14 
GeneralRe: image loop in vb.net Pin
Henry Minute7-Jun-09 1:22
Henry Minute7-Jun-09 1:22 
GeneralRe: image loop in vb.net Pin
riced7-Jun-09 1:30
riced7-Jun-09 1:30 
AnswerRe: image loop in vb.net Pin
bapu28897-Jun-09 2:29
bapu28897-Jun-09 2:29 
GeneralRe: image loop in vb.net Pin
Henry Minute7-Jun-09 4:45
Henry Minute7-Jun-09 4:45 
QuestionCommunicating over LAN in VB Net Pin
Jon11226-Jun-09 11:05
Jon11226-Jun-09 11:05 
AnswerRe: Communicating over LAN in VB Net Pin
Moreno Airoldi7-Jun-09 1:41
Moreno Airoldi7-Jun-09 1:41 
AnswerWebservice Pin
David Mujica8-Jun-09 3:29
David Mujica8-Jun-09 3:29 

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.