I want to create a class (or module) that contains the code for a button. I need to pass two variables, both of type System.Web.UI.WebControls.ListBox to the action. How do I create the button to be used in this fashion.
Here's an outline of what I need the button to do:
[tt]
Sub btnMove_Click(ByVal f as System.Object, ByVal t As System.Object) Handles btnMove.Click
If f.SelectedIndex <> -1 Then
t.Items.Add(New ListItem(f.SelectedItem.Text,
f.SelectedItem.Value))
f.Items.RemoveAt(f.SelectedIndex)
End If
End Sub
[/tt]
Also, I'm a bit rusty at this programming model... is it a Class or a Module I need.
Thanks!
Here's an outline of what I need the button to do:
[tt]
Sub btnMove_Click(ByVal f as System.Object, ByVal t As System.Object) Handles btnMove.Click
If f.SelectedIndex <> -1 Then
t.Items.Add(New ListItem(f.SelectedItem.Text,
f.SelectedItem.Value))
f.Items.RemoveAt(f.SelectedIndex)
End If
End Sub
[/tt]
Also, I'm a bit rusty at this programming model... is it a Class or a Module I need.
Thanks!