frmPenOptions.frm

 VERSION 5.00
Begin VB.Form frmPenOptions
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Pen Options --> Chaint"
   ClientHeight    =   1485
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5520
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1485
   ScaleWidth      =   5520
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdAccept
      Caption         =   "&OK"
      Default         =   -1  'True
      Height          =   375
      Left            =   2040
      TabIndex        =   5
      Top             =   1080
      Width           =   1215
   End
   Begin VB.ListBox lstPenSizes
      Height          =   255
      Left            =   1320
      TabIndex        =   4
      Top             =   600
      Width           =   4095
   End
   Begin VB.CommandButton cmdChangePenColour
      Caption         =   "&Change"
      Height          =   255
      Left            =   3360
      TabIndex        =   2
      Top             =   120
      Width           =   2055
   End
   Begin VB.Label Label1
      Caption         =   "Pen Size :"
      Height          =   255
      Left            =   120
      TabIndex        =   3
      Top             =   600
      Width           =   1095
   End
   Begin VB.Label lblPenColour
      BackColor       =   &H80000007&
      Caption         =   "0"
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   1320
      TabIndex        =   1
      Top             =   120
      Width           =   1935
   End
   Begin VB.Label lblPCInfo
      Caption         =   "Pen Colour :"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   975
   End
End
Attribute VB_Name = "frmPenOptions"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdAccept_Click()
SaveSetting "Chaint", "PenOptions", "PenColour", frmMain.ForeColor
SaveSetting "Chaint", "PenOptions", "PenWidth", frmMain.DrawWidth
Me.Hide
End Sub

Private Sub cmdChangePenColour_Click()
On Error GoTo Error

frmMain.dlgMain.ShowColor
frmMain.ForeColor = frmMain.dlgMain.Color
lblPenColour.BackColor = frmMain.dlgMain.Color
lblPenColour.Caption = frmMain.dlgMain.Color

Exit Sub
Error:
If Err.Number <> 32755 Then MsgBox "There has been an error ! " & vbNewLine & _
                                       vbNewLine & "Number = " & Err.Number & vbNewLine & _
                                       "Description = " & Err.Description, vbCritical, "Error !"
End Sub

Private Sub Form_Load()
Dim i As Integer

For i = 1 To 20
    lstPenSizes.AddItem i
Next i

lstPenSizes.ListIndex = 2
End Sub

Private Sub lstPenSizes_Click()
If lstPenSizes.ListIndex = -1 Then lstPenSizes.ListIndex = 2
frmMain.DrawWidth = CInt(lstPenSizes.Text)
End Sub

Project Homepage: