#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private Person1 As String = "Jimmy"
Private Person2 As String = "Tim"
Private Person3 As String = "Eric"
Private Person4 As String = "Joe"
Private Person5 As String = "Simon"
Private ComboBox1 As ComboBox
Private cbIndex As Int
Private btnUpdate As Button
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("1") 'Load the layout file.
MainForm.Show
UpdateComboBox
ComboBox1.SelectedIndex = 0
End Sub
Sub UpdateComboBox
ComboBox1.Items.Clear
ComboBox1.Items.AddAll(Array As String("Please select", Person1, Person2, Person3, Person4, Person5))
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Sub btnUpdate_Click
UpdateComboBox
End Sub
Sub ComboBox1_ValueChanged (Value As Object)
' Store Temporary Index
If ComboBox1.SelectedIndex >=1 Then
cbIndex = ComboBox1.SelectedIndex
Log ("Stored Index: " & cbIndex)
Log ("__________________________________")
End If
' Update Person Variable Logic
If cbIndex = 1 Then
Person1 = Value
else if cbIndex = 2 Then
Person2 = Value
else if cbIndex = 3 Then
Person3 = Value
else if cbIndex = 4 Then
Person4 = Value
else if cbIndex = 5 Then
Person5 = Value
End If
' Show Log
Log("SelectedIndex: " & ComboBox1.SelectedIndex)
Log("Value: " & Value)
Log ("__________________________________")
End Sub
Sub ComboBox1_SelectedIndexChanged(Index As Int, Value As Object)
Log("Current Index is : " & Index & " (" & Value & ")")
Log ("__________________________________")
End Sub