-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuery_Select.vb
More file actions
45 lines (37 loc) · 1.34 KB
/
Query_Select.vb
File metadata and controls
45 lines (37 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Imports System.Data
Public Class Query_Select
Private dtQueries As DataTable
Private Sub Query_Select_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ListBox1.DataSource = GetData()
ListBox1.DisplayMember = "Query"
End Sub
Private Function GetData() As DataTable
dtQueries = New DataTable()
dtQueries.Columns.Add("Query", GetType(String))
dtQueries.Rows.Add("Component Search")
dtQueries.Rows.Add("EOM Counter Update")
Return dtQueries
End Function
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
Dim dvQueries As New DataView
dvQueries = dtQueries.DefaultView
dvQueries.RowFilter = "Query LIKE '%" + TextBox1.Text + "%'"
If (dvQueries.Table.Rows.Count = 0) Then
View.Enabled = False
Else
View.Enabled = True
End If
End Sub
Private Sub View_Click(sender As Object, e As EventArgs) Handles View.Click
Try
Dim obj As New Query_View
obj.query = ListBox1.GetItemText(ListBox1.SelectedItem)
obj.Show()
Me.Hide()
Catch ex As Exception
End Try
End Sub
Private Sub Quit_Click(sender As Object, e As EventArgs) Handles Quit.Click
Me.Close()
End Sub
End Class