Find all our projects in development below.
All source code is GNU General Public License (GPL)
Browsing QuickQuery HL Edition/FindServerForm.frm (5.49 KB)
VERSION 5.00
Begin VB.Form FindServerForm
BorderStyle = 3 'Fixed Dialog
Caption = "Find Server"
ClientHeight = 1455
ClientLeft = 45
ClientTop = 330
ClientWidth = 5295
ClipControls = 0 'False
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "FindServerForm.frx":0000
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1455
ScaleWidth = 5295
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.OptionButton optnDirection
Caption = "Down"
Height = 255
Index = 1
Left = 3120
TabIndex = 4
Top = 900
Value = -1 'True
Width = 735
End
Begin VB.OptionButton optnDirection
Caption = "Up"
Height = 255
Index = 0
Left = 2520
TabIndex = 3
Top = 900
Width = 495
End
Begin VB.CheckBox chkCase
Caption = "Match &case"
Height = 255
Left = 120
TabIndex = 2
Top = 1080
Width = 1455
End
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "Cancel"
Height = 375
Left = 4080
TabIndex = 6
Top = 560
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "&Find Next"
Default = -1 'True
Enabled = 0 'False
Height = 375
Left = 4080
TabIndex = 5
Top = 80
Width = 1095
End
Begin VB.TextBox txtFind
Height = 315
Left = 1080
MaxLength = 100
TabIndex = 1
Top = 120
Width = 2895
End
Begin VB.Frame Frame1
Caption = "Direction"
Height = 735
Left = 2400
TabIndex = 7
Top = 600
Width = 1575
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Fi&nd what:"
Height = 255
Left = 120
TabIndex = 0
Top = 180
Width = 855
End
End
Attribute VB_Name = "FindServerForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo ErrHandler
Dim i As Long
Dim strText1 As String
Dim strText2 As String
strText1 = IIf(chkCase.Value = 0, LCase(txtFind.Text), txtFind.Text)
txtFind.Enabled = False
chkCase.Enabled = False
Command1.Enabled = False
If optnDirection(0).Value Then
For i = MainForm.LVServers.SelectedItem.Index - 1 To 1 Step -1
strText2 = IIf(chkCase.Value = 0, LCase(MainForm.LVServers.ListItems(i).Text), MainForm.LVServers.ListItems(i).Text)
If InStr(strText2, strText1) Then
txtFind.Enabled = True
chkCase.Enabled = True
Command1.Enabled = True
Command1.SetFocus
MainForm.SetFocus
MainForm.LVServers.SetFocus
MainForm.LVServers.ListItems(i).Selected = True
MainForm.LVServers.ListItems(i).EnsureVisible
MainForm.ClickLVServersItem MainForm.LVServers.ListItems(i)
Exit For
End If
Next i
Else
For i = MainForm.LVServers.SelectedItem.Index + 1 To MainForm.LVServers.ListItems.Count
strText2 = IIf(chkCase.Value = 0, LCase(MainForm.LVServers.ListItems(i).Text), MainForm.LVServers.ListItems(i).Text)
If InStr(strText2, strText1) Then
txtFind.Enabled = True
chkCase.Enabled = True
Command1.Enabled = True
Command1.SetFocus
MainForm.SetFocus
MainForm.LVServers.SetFocus
MainForm.LVServers.ListItems(i).Selected = True
MainForm.LVServers.ListItems(i).EnsureVisible
MainForm.ClickLVServersItem MainForm.LVServers.ListItems(i)
Exit For
End If
Next i
End If
ErrHandler:
If Not Command1.Enabled Then
Command1.Enabled = True
Command1.SetFocus
chkCase.Enabled = True
txtFind.Enabled = True
MsgBox "Cannot find """ + txtFind.Text + """", vbInformation
End If
End Sub
Private Sub Command2_Click()
Hide
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = 0 Then
Hide
Cancel = True
End If
End Sub
Private Sub txtFind_Change()
If txtFind.Text = "" Then
Command1.Enabled = False
Else
Command1.Enabled = True
End If
End Sub
Download QuickQuery HL Edition/FindServerForm.frm