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
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