Projects

Find all our projects in development below.
All source code is GNU General Public License (GPL)

QuickQuery Half-Life Edition

Browsing QuickQuery HL Edition/AddFavoriteForm.frm (3.67 KB)

VERSION 5.00
Begin VB.Form AddFavoriteForm 
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   1125
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4365
   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            =   "AddFavoriteForm.frx":0000
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1125
   ScaleWidth      =   4365
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton Command2 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   375
      Left            =   3000
      TabIndex        =   3
      Top             =   600
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "OK"
      Default         =   -1  'True
      Enabled         =   0   'False
      Height          =   375
      Left            =   1680
      TabIndex        =   2
      Top             =   600
      Width           =   1215
   End
   Begin VB.TextBox txtAddress 
      Height          =   315
      Left            =   1440
      MaxLength       =   100
      TabIndex        =   1
      Top             =   120
      Width           =   2775
   End
   Begin VB.Image ImgFavorites 
      Height          =   480
      Left            =   120
      Picture         =   "AddFavoriteForm.frx":000C
      Top             =   560
      Width           =   480
   End
   Begin VB.Label lblAddress 
      BackStyle       =   0  'Transparent
      Caption         =   "&Server Address:"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   160
      Width           =   1215
   End
End
Attribute VB_Name = "AddFavoriteForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Public ListIndex As Integer

Private Sub Command1_Click()
Dim i As Integer
Dim bFound As Boolean
Dim strFavorite As String
    strFavorite = txtAddress.Text
    If InStr(strFavorite, ":") = 0 Then strFavorite = strFavorite + ":27015"
    If ListIndex = -1 Then
        For i = 1 To UBound(FavoritesList)
            If LCase(strFavorite) = LCase(FavoritesList(i)) Then
                bFound = True
                FavoritesList(i) = strFavorite
                Exit For
            End If
        Next i
        If bFound = False Then
            ReDim Preserve FavoritesList(UBound(FavoritesList) + 1)
            FavoritesList(UBound(FavoritesList)) = strFavorite
        End If
    Else
        For i = 0 To ManageFavoritesForm.lstFavorites.ListCount - 1
            If LCase(strFavorite) = LCase(ManageFavoritesForm.lstFavorites.List(i)) And ListIndex <> i Then
                MsgBox "Server address already on list.", vbExclamation
                txtAddress.SetFocus
                txtAddress.SelStart = 0
                txtAddress.SelLength = Len(txtAddress.Text)
                Exit Sub
            End If
        Next i
        ManageFavoritesForm.lstFavorites.List(ListIndex) = strFavorite
    End If
    Unload Me
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub


Private Sub txtAddress_Change()
    If txtAddress.Text = "" Then
        Command1.Enabled = False
    Else
        Command1.Enabled = True
    End If
End Sub


Download QuickQuery HL Edition/AddFavoriteForm.frm

Back to file list


Back to project page