aio419
asked on
ListBox1_SelectedIndexChanged' is not declared.
I am adding a list box to the form like this and i am getting this error.Can you please tell me how to fix it?
Dim ListBox1 = New ListBox
ListBox1.Size = New Size(200, 100) 'set size
ListBox1.Location = New Point(10, 60) 'location
AddHandler ListBox1.SelectedIndexChan ged, AddressOf ListBox1_SelectedIndexChan ged 'add the event.
Me.Controls.Add(ListBox1)
ListBox1.MultiColumn = True
ListBox1.SelectionMode = SelectionMode.MultiExtende d
for AddressOf ListBox1_SelectedIndexChan ged it is giving error
" Name 'ListBox1_SelectedIndexCha nged' is not declared."
Dim ListBox1 = New ListBox
ListBox1.Size = New Size(200, 100) 'set size
ListBox1.Location = New Point(10, 60) 'location
AddHandler ListBox1.SelectedIndexChan
Me.Controls.Add(ListBox1)
ListBox1.MultiColumn = True
ListBox1.SelectionMode = SelectionMode.MultiExtende
for AddressOf ListBox1_SelectedIndexChan
" Name 'ListBox1_SelectedIndexCha
Have you created the event handler?
ASKER
While creating the event hander it is giving error
AddHandler ListBox1.SelectedIndexChan ged, AddressOf ListBox1_SelectedIndexChan ged
it do not like the 2nd part ie.AddressOf ListBox1_SelectedIndexChan ged
Is that what you asked?
AddHandler ListBox1.SelectedIndexChan
it do not like the 2nd part ie.AddressOf ListBox1_SelectedIndexChan
Is that what you asked?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks guys.
Okay. If you want to create a list box at run time, how we do that. Do we have to make the event hander first and then make the list box object? I am not getting that.
I thought I need to create the object and then write the event handler code.
Okay. If you want to create a list box at run time, how we do that. Do we have to make the event hander first and then make the list box object? I am not getting that.
I thought I need to create the object and then write the event handler code.
ASKER
and how much minimun point is requied to split it?
Thanks
Thanks
You have to have the event handler written before you add the handler. Second argument to the AddHandler is the name of the subroutine that handles your event
Private Sub CreateControls
Dim ListBox1 = New ListBox
ListBox1.Size = New Size(200, 100) 'set size
ListBox1.Location = New Point(10, 60) 'location
AddHandler ListBox1.SelectedIndexChan ged, AddressOf myHandler
Me.Controls.Add(ListBox1)
ListBox1.MultiColumn = True
ListBox1.SelectionMode = SelectionMode.MultiExtende d
End Sub
Private Sub myHandler(ByVal sender As Object, ByVal e As System.EventArgs)
' Do something here
End Sub
Private Sub CreateControls
Dim ListBox1 = New ListBox
ListBox1.Size = New Size(200, 100) 'set size
ListBox1.Location = New Point(10, 60) 'location
AddHandler ListBox1.SelectedIndexChan
Me.Controls.Add(ListBox1)
ListBox1.MultiColumn = True
ListBox1.SelectionMode = SelectionMode.MultiExtende
End Sub
Private Sub myHandler(ByVal sender As Object, ByVal e As System.EventArgs)
' Do something here
End Sub
I don't htink you can assign less than 20 points per person.
ASKER
okay i will increase points.
ASKER
I increasd to 40.Still i do not get split point option!
i can not ignore ZeonFlash' answer either.B'cos he explained my missing code from Chaosian's answer.
If i am not getting any other option to split the points , i will award points to Chaosian .
i do not know Chaosian can do anything to share it.
if that is the case i am very sorry ZeonFlash(even though it is only 20 points)
i can not ignore ZeonFlash' answer either.B'cos he explained my missing code from Chaosian's answer.
If i am not getting any other option to split the points , i will award points to Chaosian .
i do not know Chaosian can do anything to share it.
if that is the case i am very sorry ZeonFlash(even though it is only 20 points)
ASKER
i do not see the Split Points in that screen.( i had done in the past with 'big' points)
If you(Chaosian) can do it,please do it.Accept your first comment as the answer and ZeonFlash's first comment as the assisted answer.
Thanks
If you(Chaosian) can do it,please do it.Accept your first comment as the answer and ZeonFlash's first comment as the assisted answer.
Thanks