|
-
Dec 21st, 2006, 12:17 PM
#1
Thread Starter
Member
[RESOLVED] [2005] Syntax Problem Calling Function from Subroutine
Could someone take a look at this section of code and tell me how to fix it?
It's giving me this eror code on build:
Method 'Public Function UpdateTextBox() As Object' does not have the same signature as delegate 'Delegate Sub myDelegate()'.
I change "UpdateTextBox" from a sub to a function so it could pass arguements to function "sendData". That's when the syntax error appeared. I've been looking all over the place for the answer but I have only been coding this stuff for a few weeks so maybe I didn't search for the correct keywords.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
With SerialPort1
Some Code Here
End With
SerialPort1.Open()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Public Delegate Sub myDelegate()
Private Sub OnDataReceived(ByVal sender As Object, _
ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) _
Handles SerialPort1.DataReceived
TextBox1.Invoke(New myDelegate(AddressOf UpdateTextBox), New Object() {})
End Sub
Public Function UpdateTextBox()
Some Code Here
sendData(varOne, varTwo)
End Function
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Error Code:
Method 'Public Function UpdateTextBox() As Object' does not have the same signature as delegate 'Delegate Sub myDelegate()'.
Thank you,
Ike
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
|