home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form fMain
- BorderStyle = 3 'Fixed Dialog
- Caption = "MicroHelp VBTools 5 - MhCommand Example (OCX32)"
- ClientHeight = 3345
- ClientLeft = 2340
- ClientTop = 4110
- ClientWidth = 8145
- Height = 3750
- Left = 2280
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3345
- ScaleWidth = 8145
- ShowInTaskbar = 0 'False
- Top = 3765
- Width = 8265
- Begin VB.Frame frmGroup
- Caption = "frmGroup(0)"
- Height = 2895
- Index = 0
- Left = 180
- TabIndex = 0
- Top = 225
- Width = 4830
- Begin VB.PictureBox picDialog
- BackColor = &H00FFFFFF&
- BorderStyle = 0 'None
- Height = 1500
- Left = 270
- ScaleHeight = 1500
- ScaleWidth = 4290
- TabIndex = 29
- Top = 315
- Width = 4290
- Begin Mhcm200Lib.MhCommand cmdDialog
- Default = -1 'True
- Height = 660
- Index = 0
- Left = 495
- TabIndex = 32
- Top = 585
- Width = 1020
- _Version = 65536
- _ExtentX = 1799
- _ExtentY = 1164
- _StockProps = 79
- PictureUp = "mhcomm_a.frx":0000
- PictureDown = "mhcomm_a.frx":0592
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdDialog
- Height = 660
- Index = 1
- Left = 1575
- TabIndex = 31
- Top = 585
- Width = 1020
- _Version = 65536
- _ExtentX = 1799
- _ExtentY = 1164
- _StockProps = 79
- PictureUp = "mhcomm_a.frx":0B24
- PictureDown = "mhcomm_a.frx":10B6
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdDialog
- Height = 660
- Index = 2
- Left = 2655
- TabIndex = 30
- Top = 585
- Width = 1020
- _Version = 65536
- _ExtentX = 1799
- _ExtentY = 1164
- _StockProps = 79
- PictureUp = "mhcomm_a.frx":1648
- PictureDown = "mhcomm_a.frx":1BDA
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- End
- Begin VB.Line linDialog
- BorderWidth = 2
- Index = 2
- X1 = 4590
- X2 = 270
- Y1 = 1845
- Y2 = 1845
- End
- Begin VB.Line linDialog
- BorderWidth = 2
- Index = 1
- X1 = 4590
- X2 = 4590
- Y1 = 315
- Y2 = 1845
- End
- Begin VB.Line linDialog
- BorderWidth = 2
- Index = 0
- X1 = 270
- X2 = 270
- Y1 = 315
- Y2 = 1845
- End
- Begin VB.Label lblComment
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- Caption = "lblComment(0)"
- Height = 690
- Index = 0
- Left = 270
- TabIndex = 8
- Top = 1980
- Width = 4200
- End
- End
- Begin VB.Frame frmGroup
- Caption = "frmGroup(1)"
- Height = 2895
- Index = 1
- Left = 360
- TabIndex = 4
- Top = 540
- Width = 4830
- Begin VB.PictureBox picTool
- Height = 600
- Left = 270
- ScaleHeight = 540
- ScaleWidth = 2250
- TabIndex = 33
- Top = 630
- Width = 2310
- Begin Mhcm200Lib.MhCommand cmdAlign
- Height = 480
- Index = 0
- Left = 405
- TabIndex = 36
- Top = 45
- Width = 480
- _Version = 65536
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 79
- PictureUp = "mhcomm_a.frx":216C
- PictureDown = "mhcomm_a.frx":23BE
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = -1 'True
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdAlign
- Height = 480
- Index = 1
- Left = 855
- TabIndex = 35
- Top = 45
- Width = 480
- _Version = 65536
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 79
- PictureUp = "mhcomm_a.frx":2610
- PictureDown = "mhcomm_a.frx":2862
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = -1 'True
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdAlign
- Height = 480
- Index = 2
- Left = 1305
- TabIndex = 34
- Top = 45
- Width = 480
- _Version = 65536
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 79
- PictureUp = "mhcomm_a.frx":2AB4
- PictureDown = "mhcomm_a.frx":2D06
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = -1 'True
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- End
- Begin VB.Label lblAlign
- Alignment = 2 'Center
- Caption = "lblAlign"
- Height = 195
- Left = 270
- TabIndex = 38
- Top = 360
- Width = 2310
- End
- Begin VB.Label lblTool
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- Caption = "lblTool"
- Height = 195
- Left = 2880
- TabIndex = 37
- Top = 315
- Width = 1635
- End
- Begin Mhcm200Lib.MhCommand cmdTool
- Height = 450
- Index = 3
- Left = 3690
- TabIndex = 14
- Top = 1035
- Width = 450
- _Version = 65536
- _ExtentX = 794
- _ExtentY = 794
- _StockProps = 79
- PictureUp = "mhcomm_a.frx":2F58
- PictureDown = "mhcomm_a.frx":318A
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 1
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdTool
- Height = 450
- Index = 2
- Left = 3240
- TabIndex = 13
- Top = 1035
- Width = 450
- _Version = 65536
- _ExtentX = 794
- _ExtentY = 794
- _StockProps = 79
- PictureUp = "mhcomm_a.frx":33BC
- PictureDown = "mhcomm_a.frx":35EE
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 1
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdTool
- Height = 450
- Index = 1
- Left = 3690
- TabIndex = 12
- Top = 585
- Width = 450
- _Version = 65536
- _ExtentX = 794
- _ExtentY = 794
- _StockProps = 79
- PictureUp = "mhcomm_a.frx":3820
- PictureDown = "mhcomm_a.frx":3A52
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 1
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdTool
- Height = 450
- Index = 0
- Left = 3240
- TabIndex = 11
- Top = 585
- Width = 450
- _Version = 65536
- _ExtentX = 794
- _ExtentY = 794
- _StockProps = 79
- PictureUp = "mhcomm_a.frx":3C84
- PictureDown = "mhcomm_a.frx":3EB6
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 1
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin VB.Label lblComment
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- Caption = "lblComment(0)"
- Height = 1050
- Index = 1
- Left = 315
- TabIndex = 9
- Top = 1665
- Width = 4200
- End
- End
- Begin VB.Frame frmStyles
- Caption = "frmStyles"
- Height = 1410
- Left = 5310
- TabIndex = 1
- Top = 1215
- Width = 2580
- Begin VB.OptionButton optGroup
- Caption = "optGroup(2)"
- Height = 240
- Index = 2
- Left = 180
- TabIndex = 7
- Top = 990
- Width = 2220
- End
- Begin VB.OptionButton optGroup
- Caption = "optGroup(1)"
- Height = 240
- Index = 1
- Left = 180
- TabIndex = 6
- Top = 675
- Width = 2220
- End
- Begin VB.OptionButton optGroup
- Caption = "optGroup(0)"
- Height = 240
- Index = 0
- Left = 180
- TabIndex = 2
- Top = 360
- Width = 2220
- End
- End
- Begin VB.Frame frmGroup
- Caption = "frmGroup(0)"
- Height = 2895
- Index = 2
- Left = 630
- TabIndex = 5
- Top = 900
- Width = 4830
- Begin Mhcm200Lib.MhCommand cmdBevel
- Height = 465
- Index = 4
- Left = 900
- TabIndex = 28
- Top = 1035
- Width = 555
- _Version = 65536
- _ExtentX = 979
- _ExtentY = 820
- _StockProps = 79
- Caption = "cmdBevel(4)"
- PictureUp = "mhcomm_a.frx":40E8
- PictureDown = "mhcomm_a.frx":4104
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdBevel
- Height = 465
- Index = 3
- Left = 900
- TabIndex = 27
- Top = 540
- Width = 555
- _Version = 65536
- _ExtentX = 979
- _ExtentY = 820
- _StockProps = 79
- Caption = "cmdBevel(3)"
- PictureUp = "mhcomm_a.frx":4120
- PictureDown = "mhcomm_a.frx":413C
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdFont
- Height = 555
- Index = 0
- Left = 3420
- TabIndex = 26
- Top = 540
- Width = 1230
- _Version = 65536
- _ExtentX = 2170
- _ExtentY = 979
- _StockProps = 79
- Caption = "cmdFont(0)"
- PictureUp = "mhcomm_a.frx":4158
- PictureDown = "mhcomm_a.frx":4174
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdFont
- Height = 420
- Index = 1
- Left = 3420
- TabIndex = 25
- Top = 1125
- Width = 1230
- _Version = 65536
- _ExtentX = 2170
- _ExtentY = 741
- _StockProps = 79
- Caption = "cmdFont(1)"
- PictureUp = "mhcomm_a.frx":4190
- PictureDown = "mhcomm_a.frx":41AC
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdFont
- Height = 420
- Index = 2
- Left = 3420
- TabIndex = 24
- Top = 1575
- Width = 1230
- _Version = 65536
- _ExtentX = 2170
- _ExtentY = 741
- _StockProps = 79
- Caption = "cmdFont(2)"
- PictureUp = "mhcomm_a.frx":41C8
- PictureDown = "mhcomm_a.frx":41E4
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin VB.Label lblFont
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- Caption = "lblFont"
- Height = 195
- Left = 3600
- TabIndex = 23
- Top = 270
- Width = 960
- End
- Begin Mhcm200Lib.MhCommand cmdBorder
- Height = 465
- Index = 0
- Left = 1890
- TabIndex = 22
- Top = 540
- Width = 1140
- _Version = 65536
- _ExtentX = 2011
- _ExtentY = 820
- _StockProps = 79
- Caption = "cmdBorder(0)"
- PictureUp = "mhcomm_a.frx":4200
- PictureDown = "mhcomm_a.frx":421C
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdBorder
- Height = 465
- Index = 1
- Left = 1890
- TabIndex = 21
- Top = 1035
- Width = 1140
- _Version = 65536
- _ExtentX = 2011
- _ExtentY = 820
- _StockProps = 79
- Caption = "cmdBorder(1)"
- PictureUp = "mhcomm_a.frx":4238
- PictureDown = "mhcomm_a.frx":4254
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdBorder
- Height = 465
- Index = 2
- Left = 1890
- TabIndex = 20
- Top = 1530
- Width = 1140
- _Version = 65536
- _ExtentX = 2011
- _ExtentY = 820
- _StockProps = 79
- Caption = "cmdBorder(2)"
- PictureUp = "mhcomm_a.frx":4270
- PictureDown = "mhcomm_a.frx":428C
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin VB.Label lblBorder
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- Caption = "lblBorder"
- Height = 195
- Left = 1800
- TabIndex = 19
- Top = 270
- Width = 1320
- End
- Begin VB.Label lblBevel
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- Caption = "lblBevel"
- Height = 195
- Left = 360
- TabIndex = 18
- Top = 270
- Width = 960
- End
- Begin Mhcm200Lib.MhCommand cmdBevel
- Height = 465
- Index = 2
- Left = 585
- TabIndex = 17
- Top = 1530
- Width = 555
- _Version = 65536
- _ExtentX = 979
- _ExtentY = 820
- _StockProps = 79
- Caption = "cmdBevel(2)"
- PictureUp = "mhcomm_a.frx":42A8
- PictureDown = "mhcomm_a.frx":42C4
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdBevel
- Height = 465
- Index = 1
- Left = 270
- TabIndex = 16
- Top = 1035
- Width = 555
- _Version = 65536
- _ExtentX = 979
- _ExtentY = 820
- _StockProps = 79
- Caption = "cmdBevel(1)"
- PictureUp = "mhcomm_a.frx":42E0
- PictureDown = "mhcomm_a.frx":42FC
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin Mhcm200Lib.MhCommand cmdBevel
- Height = 465
- Index = 0
- Left = 270
- TabIndex = 15
- Top = 540
- Width = 555
- _Version = 65536
- _ExtentX = 979
- _ExtentY = 820
- _StockProps = 79
- Caption = "cmdBevel(0)"
- PictureUp = "mhcomm_a.frx":4318
- PictureDown = "mhcomm_a.frx":4334
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin VB.Label lblComment
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- Caption = "lblComment(0)"
- Height = 645
- Index = 2
- Left = 270
- TabIndex = 10
- Top = 2115
- Width = 4200
- End
- End
- Begin Mhcm200Lib.MhCommand cmdExit
- Height = 510
- Left = 6570
- TabIndex = 39
- Top = 2700
- Width = 1320
- _Version = 65536
- _ExtentX = 2328
- _ExtentY = 900
- _StockProps = 79
- Caption = "cmdExit"
- PictureUp = "mhcomm_a.frx":4350
- PictureDown = "mhcomm_a.frx":436C
- Autosize = -1 'True
- Alignment = 2
- FontTransparent = -1 'True
- MultiLine = 0 'False
- StateButton = 0 'False
- Value = 0 'False
- FontStyle = 0
- BevelSize = 2
- BorderColor = -2147483642
- BorderStyle = 2
- FillColor = -2147483633
- LightColor = -2147483628
- ShadowColor = -2147483632
- TextColor = -2147483630
- WallPaper = 0
- BevelStyle = 1
- End
- Begin VB.Label lblDescription
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- Caption = "lblDescription"
- Height = 1050
- Left = 5085
- TabIndex = 3
- Top = 135
- Width = 2895
- End
- Attribute VB_Name = "fMain"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim keyCR As String
- Private Sub cmdDialog_Click(Index As Integer)
- Dim sMsg As String
- Select Case Index
- ' OK.
- Case 0
- sMsg = "OK pressed."
- sMsg = sMsg & keyCR & keyCR & "Remember to trap KeyAscii = 13 in the Form_KeyPress "
- sMsg = sMsg & keyCR & "event if you want to simulate the .Default property "
- sMsg = sMsg & keyCR & "for this button."
- ' Cancel.
- Case 1
- sMsg = "Cancel pressed."
- sMsg = sMsg & keyCR & keyCR & "Remember to trap KeyAscii = 27 in the Form_KeyPress "
- sMsg = sMsg & keyCR & "event if you want to simulate the .Cancel property "
- sMsg = sMsg & keyCR & "for this button."
- ' Help.
- Case 2
- sMsg = "Help pressed."
- sMsg = sMsg & keyCR & keyCR & "Remember to trap KeyCode = 112 in the Form_KeyDown "
- sMsg = sMsg & keyCR & "event if you want to simulate context sensitive help."
- End Select
- ' Display info on button.
- MsgBox sMsg, 0, frmGroup(0).Caption
- End Sub
- Private Sub cmdAlign_Click(Index As Integer)
- Dim iCount As Integer
- Static bBeenHere As Boolean
- If bBeenHere Then Exit Sub
- bBeenHere = True
- For iCount = 0 To 2
- cmdAlign(iCount).Value = (iCount = Index)
- Next iCount
- bBeenHere = False
- End Sub
- Private Sub cmdExit_Click()
- Unload Me
- End Sub
- Private Sub cmdTool_Click(Index As Integer)
- Dim iCount As Integer
- Static bBeenHere As Boolean
- If bBeenHere Then Exit Sub
- bBeenHere = True
- For iCount = 0 To 3
- cmdTool(iCount).Value = (iCount = Index)
- Next iCount
- bBeenHere = False
- End Sub
- Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
- ' We are only trapping for buttons on the
- ' first frame (dialog buttons), so exit otherwise.
- If Not optGroup(0).Value Then Exit Sub
- ' F1 = Help button.
- If KeyCode = 112 Then
- MsgBox "Help pressed.", 0, frmGroup(0).Caption
- End If
- End Sub
- Private Sub Form_KeyPress(KeyAscii As Integer)
- ' We are only trapping for buttons on the
- ' first frame (dialog buttons), so exit otherwise.
- If Not optGroup(0).Value Then Exit Sub
- Select Case KeyAscii
- ' Enter = OK button.
- Case 13
- MsgBox "OK pressed.", 0, frmGroup(0).Caption
- ' Get rid of beep.
- KeyAscii = 0
- ' ESC = Cancel button.
- Case 27
- MsgBox "Cancel pressed.", 0, frmGroup(0).Caption
- End Select
- End Sub
- Private Sub Form_Load()
- keyCR = Chr$(13) & Chr$(10)
- ' Display captions for controls.
- LoadCaptions
- ' .KeyPreview is set to trap the dialog buttons
- ' in the form's _KeyPress and _KeyDown events.
- Me.KeyPreview = True
- ' center form to screen
- Move Abs(Screen.Width - Width) \ 2, Abs(Screen.Height - Height) \ 2
- End Sub
- Private Sub LoadCaptions()
- Dim sCaption As String
- Dim iCount As Integer
- ' Form controls.
- sCaption = "The MhCommand control adds several properties to the "
- sCaption = sCaption & "standard Command button to allow you to add images, "
- sCaption = sCaption & "create state buttons, or customize any of the graphical "
- sCaption = sCaption & "aspects of the control."
- lblDescription.Caption = sCaption
- cmdExit.Caption = "E&xit"
- ' Frames.
- frmGroup(0).Caption = "Standard Dialog Buttons"
- frmGroup(1).Caption = "State Buttons"
- frmGroup(1).Move frmGroup(0).Left, frmGroup(0).Top
- frmGroup(2).Caption = "Button Styles"
- frmGroup(2).Move frmGroup(0).Left, frmGroup(0).Top
- frmStyles.Caption = "Styles"
- ' Option buttons.
- optGroup(0).Caption = "Standard Dialog Buttons"
- optGroup(1).Caption = "State Buttons"
- optGroup(2).Caption = "Button Styles"
- ' Comments within frames.
- sCaption = "The MhCommand control can be used with supplied bitmaps "
- sCaption = sCaption & "to give the appearance of standard dialog buttons. "
- lblComment(0).Caption = sCaption
- sCaption = "The MhCommand control can be configured to work as "
- sCaption = sCaption & "a state button. These are set up in groups or "
- sCaption = sCaption & "toolbars in place of option buttons."
- lblComment(1).Caption = sCaption
- sCaption = "The .Bevel*, .Border*, and .Font* properties give you "
- sCaption = sCaption & "the ability to customize the MhCommand control "
- sCaption = sCaption & "to appear however you want (within reason)."
- lblComment(2).Caption = sCaption
- ' Configure all of the buttons.
- lblBevel.Caption = "Bevel Effects"
- cmdBevel(0).Caption = ""
- cmdBevel(1).Caption = ""
- cmdBevel(2).Caption = ""
- cmdBevel(3).Caption = ""
- cmdBevel(4).Caption = ""
- For iCount = 0 To 4
- cmdBevel(iCount).BevelStyle = iCount
- Next iCount
- lblBorder.Caption = "Border Effects"
- cmdBorder(0).Caption = "None"
- cmdBorder(1).Caption = "Single"
- cmdBorder(2).Caption = "Rounded"
- For iCount = 0 To 2
- cmdBorder(iCount).BorderStyle = iCount
- Next iCount
- lblFont.Caption = "Fonts"
- cmdFont(0).Caption = "Multiple Lines of Text"
- cmdFont(0).MultiLine = True
- cmdFont(1).Caption = "Raised"
- cmdFont(1).FontStyle = 1
- cmdFont(2).Caption = "Lowered"
- cmdFont(2).FontStyle = 3
- ' Labels on frame 1.
- lblAlign.Caption = "Button Bar Buttons"
- lblTool.Caption = "Tool Bar Buttons"
- End Sub
- Private Sub optGroup_Click(Index As Integer)
- Dim iCount As Integer
- For iCount = 0 To 2
- frmGroup(iCount).Visible = (iCount = Index)
- Next iCount
- End Sub
-