Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class vs Module

Status
Not open for further replies.

JGresko

Programmer
Apr 24, 2002
86
US
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!

 
Module.

I use a similar looking sub to toggle all textboxes on my pages to background=grey or background=white

D'Arcy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top