Up | Example 01 - ComboBox | Example 02 - ListBox | Example 03 - Labels class derived from Winforms.Panel | Example 04 - Button with Resize Event | Example 05 - CheckBox | Example 06 - GroupBox | Example 07 - Modeless Status Dialog | Example 08 -Timer | Example 09 -TextBox | Example 10 - Custom Button Class | Example 11 - Product Selection ComboBox | Example 12 - Simple ListView

 

  

 
Example 02 - ListBox
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

 

 

Scorpion Vision Version XII : Build 646 - Date: 20170225
Scorpion Vision Software® is a registered trademark of Tordivel AS.
Copyright © 2000 - 2017 Tordivel AS.