The following defines the creation of a ListBox in a Panel or Form derived
class.# Create the listBox
self.listBox = WinForms.ListBox()
self.listBox.Parent = self
self.listBox.Size = Size(100,100)
self.listBox.Location = Point(100,130)
# add items
self.listBox.Items.Add("3")
self.listBox.Items.Add("4")
self.listBox.Items.Add("1")
# set selection
self.comboBox.Text = "4"
self.listBox.SelectedValueChanged += self.listBox_SelectedValueChangedHandler
# eventhandler
def listBox_SelectedValueChangedHandler(self, sender, args):
print self.listBox.Text
|