|
-
May 18th, 2008, 10:01 AM
#1
Can anyone change the code from C# to vb.net?
Can anyone change code from C# to vb.net. The code is as below:
public void UpdateTextBox(string data)
{
if ( txtOutput.InvokeRequired )
txtOutput.Invoke(new OutputUpdateDelegate(OutputUpdateCallback),
new object[] { data });
else
OutputUpdateCallback(data); //call directly
}
private void OutputUpdateCallback(string data)
{
txtOutput.Text += data;
}
I have tried and that has error on row
txtOutput.Invoke(new OutputUpdateDelegate(OutputUpdateCallback),
My code is
Public Sub UpdateTextBox(ByVal data As String)
If (TextBox2.InvokeRequired) Then
TextBox2.Invoke(New OutputUpdateDelegate(OutputUpdateCallback), New Object() {data})
Else
OutputUpdateCallback(data) ' //call directly
End If
End Sub
Private Sub OutputUpdateCallback( data As String)
TextBox2.Text += Data
End Sub
thanks in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|