GFMsgBox/Testfrm.frm
VERSION 5.00
Begin VB.Form Testfrm
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4695
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4695
StartUpPosition = 3 'Windows‑Standard
Begin VB.CommandButton Command3
Caption = "create a GFStatisticsBox"
Height = 435
Left = 1560
TabIndex = 2
Top = 1380
Width = 2175
End
Begin VB.CommandButton Command2
Caption = "create a GFInputBox"
Height = 435
Left = 840
TabIndex = 1
Top = 840
Width = 2175
End
Begin VB.CommandButton Command1
Caption = "create a GFMsgBox"
Height = 435
Left = 120
TabIndex = 0
Top = 300
Width = 2175
End
End
Attribute VB_Name = "Testfrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'(c)2001, 2004 by Louis. Test for GFMsgBox.
'
'Downloaded from www.louis‑coder.com.
'This project demonstrates how to create a custom MsgBox, InputBox and an MsgBox
'that can be used to display statistical data (monospaced font used).
'The GFSkinEngine can be entangled to create skinned boxes. Sorry, this feature is not
'available in the downloadable version (as the Skin Engine is hard to use and not ALL
'features work correctly (detailed knowledge required)).
'
#Const GFSkinEngineAvailableFlag = False 'do not enable in downloadable version
Private Sub Form_Activate()
On Error Resume Next
Call GFMsgBoxfrm.MsgBoxText.SetFocus
End Sub
Private Sub Form_GotFocus()
Call GFMsgBoxfrm.MsgBoxText.SetFocus
End Sub
Private Sub Form_Load()
'on error resume next
Dim ProgramPath As String
#If GFSkinEngineAvailableFlag = True Then
Dim SystemFont As FontStruct 'stays uninitialized to test the Skin Engine
#End If
'preset
ProgramPath = App.Path
If Not (Right$(ProgramPath, 1) = "\") Then ProgramPath = ProgramPath + "\" 'verify
'begin
#If GFSkinEngineAvailableFlag = True Then
Call SE_Initialize(RGB(255, 255, 255), 0, SystemFont, "", True, ProgramPath + "Skins\", HKEY_LOCAL_MACHINE, "Software\GFMsgBox Text", Nothing, False)
Call SE_RegisterControl("GFMsgBoxfrm", GFMsgBoxfrm, SECONTROLTYPE_GFMSGBOX)
Call Skin_Change("")
Call SE_DisplayPalette(‑1, ‑1, True, True)
#End If
End Sub
Private Sub Command1_Click()
'on error resume next
Dim CaptionArray(1 To 3) As String
'preset
CaptionArray(1) = "Register"
CaptionArray(2) = "Destroy"
CaptionArray(3) = "Don't know"
#If GFSkinEngineAvailableFlag = True Then
Call GFMsgBoxfrm.GFMsgBox_EnableSkinning(37)
#End If
Call GFMsgBoxfrm.GFMsgBox_SetFont("Arial", 12, False, False, False, False)
Debug.Print GFMsgBox(String$(500, "a"), vbOKOnly + vbQuestion, "", 3, CaptionArray())
End Sub
Private Sub Command2_Click()
'on error resume next
Debug.Print GFInputBox("Enter password", "Password", "", True)
End Sub
Private Sub Command3_Click()
'on error resume next
Debug.Print GFStatisticsBox("Blah ‑> Blahblah" + Chr$(13) + Chr$(10) + "1 5", "Statistics")
End Sub
Private Sub Form_Unload(Cancel As Integer)
'on error resume next
#If GFSkinEngineAvailableFlag = True Then
Call SE_Terminate
Call GFSubClass_Terminate
#End If
End Sub
[END OF FILE]