Results 1 to 22 of 22

Thread: how to make callback

Hybrid View

  1. #1
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: how to make callback

    You don't invoke RunServer because that will just try to run EVERYTHING again. You write a method just like my SetText method (or in your case AppendText might be better) and you call that. It will create the delegate if required.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  2. #2

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    14

    Re: how to make callback

    I made the method AppendText

    VB Code:
    1. private Delegate Sub AppendTextDelegate(ByVal text As String)
    2.   Private Sub ApendText(ByVal text As String)
    3.         If Me.txtDisplay.InvokeRequired Then
    4.             Me.txtDisplay.Invoke(New AppendTextDelegate(AddressOf ApendText), text)
    5.         Else
    6.             Me.txtDisplay.Text = text
    7.         End If
    8.     End Sub

    i actually tried this before your post, then where do i call this in the while loop. i know the error is at

    txtDisplay.Text = "Waiting for conenction" & vbCrLf

    sorry about this, im new to VB.NET

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width