|
-
Mar 18th, 2007, 03:25 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] [2005] Why does this not change???
I have this code, but the text on button4 never changes when i click in my listbox
Code:
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Button4.Text = ListBox1.SelectedItem
End Sub
-
Mar 18th, 2007, 03:38 PM
#2
Re: [2005] Why does this not change???
Is this a Windows app or Web application??
Furthermore, you forgot to add the handler of the selectedindexchanged event.
Code should be:
Code:
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Button4.Text = ListBox1.SelectedItem
End Sub
-
Mar 18th, 2007, 03:38 PM
#3
Re: [2005] Why does this not change???
Try changing
vb Code:
Button4.Text= ListBox1.SelectedItem
to
vb Code:
Button4.Text= ListBox1.Text
Sometimes the Programmer
Sometimes the DBA
Mazz1
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
|