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