Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim _DR As DataRow
Dim _DT As New DataTable
_DT.Columns.Add("Data")
_DT.Columns.Add("SQLString")
_DR = _DT.NewRow
_DR("Data") = "น้อยกว่า 1175"
_DR("SQLString") = "Transformer_size < 1175"
_DT.Rows.Add(_DR)
_DR = _DT.NewRow
_DR("Data") = "1175 ถึง 3529"
_DR("SQLString") = "Transformer_size >= 1175 And Transformer_size <= 3529"
_DT.Rows.Add(_DR)
_DR = _DT.NewRow
_DR("Data") = "มากกว่า 3529"
_DR("SQLString") = "Transformer_size > 3529"
_DT.Rows.Add(_DR)
ComboBox1.DataSource = _DT
ComboBox1.DisplayMember = "Data"
ComboBox1.ValueMember = "SQLString"
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Try
Me.Text = ComboBox1.SelectedValue
Catch ex As Exception
ComboBox1.Text = Nothing
End Try
End Sub