Click here to Skip to main content
15,888,351 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionUDP Protocol Pin
Member 125763031-Jul-16 2:06
Member 125763031-Jul-16 2:06 
QuestionRe: UDP Protocol Pin
Ralf Meier6-Jul-16 4:23
mveRalf Meier6-Jul-16 4:23 
AnswerRe: OT Pin
Richard MacCutchan16-Jul-16 1:33
mveRichard MacCutchan16-Jul-16 1:33 
GeneralRe: OT Pin
Ralf Meier16-Jul-16 10:12
mveRalf Meier16-Jul-16 10:12 
AnswerRe: UDP Protocol Pin
Simon_Whale6-Jul-16 5:08
Simon_Whale6-Jul-16 5:08 
QuestionBarcodes iTextSharp Pin
Petgil2527-Jun-16 9:24
Petgil2527-Jun-16 9:24 
QuestionVB Threading between classes update textbox Pin
saj65526-Jun-16 12:51
saj65526-Jun-16 12:51 
AnswerRe: VB Threading between classes update textbox Pin
Richard Deeming27-Jun-16 3:42
mveRichard Deeming27-Jun-16 3:42 
Try passing the real instance of Form1 to the doSomething class, rather than relying on the auto-created instance that only exists for VB6 compatibility.
VB.NET
Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim a As New doSomething
        a.Target = Me.TextBox1
        
        Dim s As New Threading.Thread(AddressOf a.update)
        s.IsBackground = True
        s.Start()
    End Sub
End Class

Public Class doSomething
    Public Property Target As TextBox
    
    Public Sub update()
        SetControlText(Target, "Hey Please Update the Textbox")
    End Sub
    
    Private Shared Sub SetControlText(ByVal ctl As TextBox, ByVal text As String)
        If ctl.InvokeRequired Then
            ctl.Invoke(New Action(Of TextBox, String)(AddressOf SetControlText), ctl, text)
        Else
            ctl.Text = text
        End If
    End Sub
End Class




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


QuestionExample Lynx Grid Records Save to Database Pin
dongodu26-Jun-16 9:23
dongodu26-Jun-16 9:23 
QuestionLynx Grid Records Save to Database Pin
dongodu26-Jun-16 9:21
dongodu26-Jun-16 9:21 
QuestionWord For Mac 2016 - Set Margins Macro Pin
Member 1260347325-Jun-16 3:26
Member 1260347325-Jun-16 3:26 
GeneralRe: Word For Mac 2016 - Set Margins Macro Pin
Richard MacCutchan25-Jun-16 20:45
mveRichard MacCutchan25-Jun-16 20:45 
GeneralRe: Word For Mac 2016 - Set Margins Macro Pin
Member 1260347326-Jun-16 2:35
Member 1260347326-Jun-16 2:35 
GeneralRe: Word For Mac 2016 - Set Margins Macro Pin
Richard MacCutchan26-Jun-16 2:41
mveRichard MacCutchan26-Jun-16 2:41 
GeneralRe: Word For Mac 2016 - Set Margins Macro Pin
Member 1260347326-Jun-16 3:18
Member 1260347326-Jun-16 3:18 
GeneralRe: Word For Mac 2016 - Set Margins Macro Pin
Richard MacCutchan26-Jun-16 6:11
mveRichard MacCutchan26-Jun-16 6:11 
GeneralRe: Word For Mac 2016 - Set Margins Macro Pin
Member 1260347326-Jun-16 14:07
Member 1260347326-Jun-16 14:07 
GeneralRe: Word For Mac 2016 - Set Margins Macro Pin
Richard MacCutchan26-Jun-16 20:41
mveRichard MacCutchan26-Jun-16 20:41 
GeneralRe: Word For Mac 2016 - Set Margins Macro Pin
Member 1260347327-Jun-16 0:05
Member 1260347327-Jun-16 0:05 
QuestionFindcontrol does not work for Usercontrol Pin
Mozartoz24-Jun-16 3:31
Mozartoz24-Jun-16 3:31 
QuestionRe: Findcontrol does not work for Usercontrol Pin
CHill6024-Jun-16 4:09
mveCHill6024-Jun-16 4:09 
AnswerRe: Findcontrol does not work for Usercontrol Pin
Mozartoz24-Jun-16 4:17
Mozartoz24-Jun-16 4:17 
QuestionRe: Findcontrol does not work for Usercontrol Pin
CHill6024-Jun-16 5:00
mveCHill6024-Jun-16 5:00 
AnswerRe: Findcontrol does not work for Usercontrol Pin
Mozartoz24-Jun-16 5:12
Mozartoz24-Jun-16 5:12 
GeneralRe: Findcontrol does not work for Usercontrol Pin
Eddy Vluggen24-Jun-16 10:02
professionalEddy Vluggen24-Jun-16 10:02 

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.