home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 4.00 Begin VB.Form fMhMultiple BorderStyle = 1 'Fixed Single Caption = "Form1" ClientHeight = 4272 ClientLeft = 2616 ClientTop = 1608 ClientWidth = 3276 BeginProperty Font name = "MS Sans Serif" charset = 0 weight = 700 size = 7.8 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 4644 Left = 2568 LinkTopic = "Form1" ScaleHeight = 4272 ScaleWidth = 3276 Top = 1284 Width = 3372 Begin VB.PictureBox Picture2 BorderStyle = 0 'None BeginProperty Font name = "MS Sans Serif" charset = 0 weight = 700 size = 7.8 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty Height = 615 Left = 0 ScaleHeight = 612 ScaleWidth = 3372 TabIndex = 11 Top = 3720 Width = 3375 Begin MhmultiLib.MhMultiple MhMultiple2 Height = 495 Index = 6 Left = 2880 TabIndex = 18 Top = 0 Width = 375 _Version = 65536 _ExtentX = 661 _ExtentY = 873 _StockProps = 65 BackColor = -2147483643 TintColor = 16711935 Value = 0 Style = 0 Autosize = 0 'False AutoSwitch = 0 Edges = 0 'False End Begin MhmultiLib.MhMultiple MhMultiple2 Height = 495 Index = 5 Left = 2400 TabIndex = 17 Top = 0 Width = 375 _Version = 65536 _ExtentX = 661 _ExtentY = 873 _StockProps = 65 BackColor = -2147483643 TintColor = 16711935 Value = 0 Style = 0 Autosize = 0 'False AutoSwitch = 0 Edges = 0 'False End Begin MhmultiLib.MhMultiple MhMultiple2 Height = 495 Index = 4 Left = 1920 TabIndex = 16 Top = 0 Width = 375 _Version = 65536 _ExtentX = 661 _ExtentY = 873 _StockProps = 65 BackColor = -2147483643 TintColor = 16711935 Value = 0 Style = 0 Autosize = 0 'False AutoSwitch = 0 Edges = 0 'False End Begin MhmultiLib.MhMultiple MhMultiple2 Height = 495 Index = 3 Left = 1440 TabIndex = 15 Top = 0 Width = 375 _Version = 65536 _ExtentX = 661 _ExtentY = 873 _StockProps = 65 BackColor = -2147483643 TintColor = 16711935 Value = 0 Style = 0 Autosize = 0 'False AutoSwitch = 0 Edges = 0 'False End Begin MhmultiLib.MhMultiple MhMultiple2 Height = 495 Index = 2 Left = 960 TabIndex = 14 Top = 0 Width = 375 _Version = 65536 _ExtentX = 661 _ExtentY = 873 _StockProps = 65 BackColor = -2147483643 TintColor = 16711935 Value = 0 Style = 0 Autosize = 0 'False AutoSwitch = 0 Edges = 0 'False End Begin MhmultiLib.MhMultiple MhMultiple2 Height = 495 Index = 1 Left = 480 TabIndex = 13 Top = 0 Width = 375 _Version = 65536 _ExtentX = 661 _ExtentY = 873 _StockProps = 65 BackColor = -2147483643 TintColor = 16711935 Value = 0 Style = 0 Autosize = 0 'False AutoSwitch = 0 Edges = 0 'False End Begin MhmultiLib.MhMultiple MhMultiple2 Height = 495 Index = 0 Left = 0 TabIndex = 12 Top = 0 Width = 375 _Version = 65536 _ExtentX = 661 _ExtentY = 873 _StockProps = 65 BackColor = -2147483643 TintColor = 16711935 Value = 0 Style = 0 Autosize = 0 'False AutoSwitch = 0 Edges = 0 'False End End Begin VB.CommandButton cmdValue Appearance = 0 'Flat BackColor = &H80000005& Caption = "Command1" BeginProperty Font name = "MS Sans Serif" charset = 0 weight = 700 size = 7.8 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty Height = 372 Index = 3 Left = 2520 TabIndex = 4 Top = 960 Width = 492 End Begin VB.CommandButton cmdValue Appearance = 0 'Flat BackColor = &H80000005& Caption = "Command1" BeginProperty Font name = "MS Sans Serif" charset = 0 weight = 700 size = 7.8 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty Height = 372 Index = 2 Left = 1800 TabIndex = 3 Top = 960 Width = 492 End Begin VB.CommandButton cmdValue Appearance = 0 'Flat BackColor = &H80000005& Caption = "Command1" BeginProperty Font name = "MS Sans Serif" charset = 0 weight = 700 size = 7.8 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty Height = 372 Index = 1 Left = 1080 TabIndex = 2 Top = 960 Width = 492 End Begin VB.CommandButton cmdValue Appearance = 0 'Flat BackColor = &H80000005& Caption = "Command1" BeginProperty Font name = "MS Sans Serif" charset = 0 weight = 700 size = 7.8 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty Height = 372 Index = 0 Left = 360 TabIndex = 1 Top = 960 Width = 492 End Begin VB.PictureBox Picture1 BeginProperty Font name = "MS Sans Serif" charset = 0 weight = 700 size = 7.8 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty Height = 612 Left = 360 ScaleHeight = 564 ScaleWidth = 2604 TabIndex = 0 Top = 252 Width = 2652 Begin MhmultiLib.MhMultiple MhMultiple1 Height = 372 Index = 4 Left = 2052 TabIndex = 10 Top = 72 Width = 372 _Version = 65536 _ExtentX = 661 _ExtentY = 661 _StockProps = 65 BackColor = -2147483643 TintColor = 16711935 Value = 0 Style = 0 Autosize = 0 'False AutoSwitch = 0 Edges = 0 'False End Begin MhmultiLib.MhMultiple MhMultiple1 Height = 420 Index = 3 Left = 1440 TabIndex = 9 Top = 108 Width = 372 _Version = 65536 _ExtentX = 656 _ExtentY = 741 _StockProps = 65 BackColor = -2147483643 TintColor = 16711935 Value = 0 Style = 0 Autosize = 0 'False AutoSwitch = 0 Edges = 0 'False End Begin MhmultiLib.MhMultiple MhMultiple1 Height = 132 Index = 2 Left = 1080 TabIndex = 8 Top = 180 Width = 132 _Version = 65536 _ExtentX = 238 _ExtentY = 238 _StockProps = 65 BackColor = -2147483643 TintColor = 16711935 Value = 0 Style = 0 Autosize = 0 'False AutoSwitch = 0 Edges = 0 'False End Begin MhmultiLib.MhMultiple MhMultiple1 Height = 375 Index = 1 Left = 600 TabIndex = 7 Top = 120 Width = 255 _Version = 65536 _ExtentX = 450 _ExtentY = 661 _StockProps = 65 BackColor = -2147483643 TintColor = 16711935 Value = 0 Style = 0 Autosize = 0 'False AutoSwitch = 0 Edges = 0 'False End Begin MhmultiLib.MhMultiple MhMultiple1 Height = 375 Index = 0 Left = 120 TabIndex = 6 Top = 120 Width = 255 _Version = 65536 _ExtentX = 450 _ExtentY = 661 _StockProps = 65 BackColor = -2147483643 TintColor = 16711935 Value = 0 Style = 0 Autosize = 0 'False AutoSwitch = 0 Edges = 0 'False End End Begin MhtimerLib.MhTimer MhTimer1 Height = 336 Left = 0 TabIndex = 19 Top = 3240 Width = 336 _Version = 65536 _ExtentX = 593 _ExtentY = 593 _StockProps = 64 TintColor = 16711935 Interval = 0 End Begin VB.Label lblXplain Caption = "Label1" BeginProperty Font name = "MS Sans Serif" charset = 0 weight = 700 size = 7.8 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty Height = 2175 Left = 360 TabIndex = 5 Top = 1440 Width = 2655 End Attribute VB_Name = "fMhMultiple" Attribute VB_Creatable = False Attribute VB_Exposed = False Option Explicit Const im_NONE = 0 Const im_TRUE = -1, im_FALSE = 0 Const im_LIGHT = 0, im_BIGBUTTON = 1, im_TINYBUTTON = 2, im_SWITCH = 3, im_FACES = 4 Const im_RED = 0, im_YELLOW = 1, im_GREEN = 2, im_GRAY = 3 Const im_LEAD = 0, im_STATE = 1, im_COLOR = 2 Private Sub cmdValue_Click(Index As Integer) 'Set values for MhMultiples Dim iIndex As Integer For iIndex = 0 To 4 MhMultiple1(iIndex).Value = Index Next lblXplain.Caption = Xplain(im_STATE) End Sub Private Sub Form_Load() 'Because this is an example, everything that isn't 'explicitly a design-time property will be set in 'code. This routine sets all the defaults for the 'app. Dim iIndex As Integer 'Set properties for form fMhMultiple.Caption = "MhMultiple Control" 'Set picture box container properties Picture2.BorderStyle = im_NONE Picture1.Left = 340 'Set properties for MhMultiple MhMultiple1(1).Style = im_BIGBUTTON MhMultiple1(1).Value = im_YELLOW MhMultiple1(2).Style = im_TINYBUTTON MhMultiple1(2).Value = im_GREEN MhMultiple1(3).Style = im_SWITCH MhMultiple1(3).Value = im_GREEN MhMultiple1(3).Top = MhMultiple1(3).Top - 60 MhMultiple1(4).Style = im_FACES MhMultiple1(4).Value = im_RED 'Set multiples at bottom of form For iIndex = 0 To 6 MhMultiple2(iIndex).Top = 45 Next For iIndex = 0 To 6 MhMultiple2(iIndex).Style = im_FACES Next MhMultiple2(1).Value = im_YELLOW MhMultiple2(2).Value = im_GREEN MhMultiple2(3).Value = im_GRAY MhMultiple2(5).Value = im_YELLOW MhMultiple2(6).Value = im_GREEN 'Set properties for cmdValue For iIndex = 0 To 3 cmdValue(iIndex).Caption = Str$(iIndex + 1) cmdValue(iIndex).Left = cmdValue(iIndex).Left - 20 Next 'Set timer interval MhTimer1.Interval = 500 'Set properties for label lblXplain.WordWrap = True lblXplain.Caption = Xplain(im_LEAD) ' center form to screen Move Abs(Screen.Width - Width) \ 2, Abs(Screen.Height - Height) \ 2 End Sub Private Sub MhMultiple1_Click(Index As Integer) 'Cycle through values when clicked on If MhMultiple1(Index).Value = im_GRAY Then MhMultiple1(Index).Value = im_RED Else MhMultiple1(Index).Value = MhMultiple1(Index).Value + 1 End If lblXplain.Caption = Xplain(im_COLOR) End Sub Private Sub MhMultiple2_Click(Index As Integer) 'Set the flag to turn the faces at the bottom off 'if the user gets sick of them If MhTimer1.Enabled = True Then MhTimer1.Enabled = False Else MhTimer1.Enabled = True End If End Sub Private Sub MhTimer1_Timer() 'This executes routine to make faces change 'at bottom of form 'Dimension variables Static iActive As Integer Static iCurrent As Integer Dim iIndex As Integer Dim iValue As Integer 'Avoid recursion, otherwise set flag to true If iActive Then Exit Sub iActive = im_TRUE 'Reduce the value for each of the controls 'If a value is zero, start over at 3 For iIndex = 0 To 6 iValue = MhMultiple2(iIndex).Value - 1 If iValue < 0 Then iValue = 3 End If MhMultiple2(iIndex).Value = iValue Next 'Set flag when we exit routine iActive = im_FALSE End Sub Private Function Xplain(Index As Integer) As String 'Returns text for label Select Case Index Case im_LEAD Xplain = "When screen real estate is at a premium, programmers can use MhMulti control, a bitmapped button that supports up to four different states. Click on an individual control to cycle through the color-coordinated states or click a button to see what bitmap is associated with that value." Case im_STATE Xplain = "By giving programmers the choice of four states, MhMulti allows a single button to stand for up to four different conditions, eliminating the need for extra toggle buttons on the form to address separate conditions. You can address multiple conditions with one control." Case im_COLOR Xplain = "One of the great strengths of MhMulti is that it uses easily understood colors to alert your enduser to the button's value. Because the colors and symbols are easily understood, the learning curve for your program is reduced and users become more productive more quickly." End Select End Function