-
October 13th, 2003, 02:59 PM
#1
Option Strict On Disallows Late Binding
Does anyone know how to resolve this error?
Option Strict On Disallows Late Binding
My code is as follows:
Private Sub Data_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnGetData.Click, _
btnSetData.Click
Select Case sender.name
Case btnGetData.Name
fileData = New FileData
fileData.FileName = CurDir() & "Test.txt"
txtFileData.Text = fileData.GetData()
fileData = Nothing
Case btnSetData.Name
Remainder of code goes here.....
The error occurs on this statement:
"Select Case sender.name"
Any help would be appreciated!
Thanks,
Bob
p.s. I tried using ctype and directCast on the Sender.Name reference, but I was not able to succesfully convert it.
-
October 13th, 2003, 03:40 PM
#2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim snd As Button = DirectCast(sender, Button)
MsgBox(snd.Name)
End Sub
-
October 13th, 2003, 06:38 PM
#3
Perfect-a-mundo my friend! Thanks for the help!
Bob
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
|