Microsoft KB Archive/81459

= How to Use HORZ1.BMP with Professional Toolkit Gauge Control =

Article ID: 81459

Article Last Modified on 2/22/2007

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Windows 2000 Readiness Analyzer

-



This article was previously published under Q81459



SUMMARY
This article contains a program example of using the Visual Basic for Windows Gauge custom control (GAUGE.VBX) with the HORZ1.BMP bitmap file.



MORE INFORMATION
NOTE: The GAUGE.VBX custom control file can be found in the \Windows\System subdirectory. The HORZ1.BMP bitmap file can be found in the \BITMAPS\GUAGE subdirectory that was created during installation.

Example Program
 Run Visual Basic for Windows, or from the File menu, choose New Project (press ALT, F, N) if Visual Basic for Windows is already running. Form1 is created by default. From the File menu, choose Add File. In the Files box, select the GAUGE.VBX custom control file. The Gauge tool will appear in the toolbox.  Create the following controls for Form1:   Control      Name          Property Setting -

Timer       Timer1        Interval = 1 Gauge       Gauge1        Picture = &quot;Horz1.BMP&quot; Max = 50 InnerBottom = 16 InnerLeft = 38 InnerRight = 2 InnerTop = 14 ForeColor = &HFF& (In Visual Basic version 1.0 for Windows, set the CtlName Property for the above objects instead of the Name property.)   Add the following line to the General Declarations section: Dim YoYo As Integer   Add the following code to the Form_Load event procedure: Sub Form_Load Form1.Caption = &quot;YoYo Gauge Demo&quot; Gauge1.Value = Gauge1.Min End Sub   Add the following code to the Timer1_Timer event procedure: Sub Timer1_Timer If Gauge1.Value = Gauge1.Max Then YoYo = -1 If Gauge1.Value = Gauge1.Min Then YoYo = 1 Gauge1.Value = Gauge1.Value + YoYo End Sub </li></ol>

When run, this program example will alternately fill and empty the gauge control's fill area, as controlled by the Timer event procedure.

Additional query words: 1.00 2.00 3.00

Keywords: KB81459

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.