Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual Basic
Expertise: Intermediate
Aug 21, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Make a Gauge with MicroHelp's Controls

You can make a beautiful gauge by combining two MicroHelp controls. Place a Mh3d control onto your form and set the inner bevel just inside of the outer bevel. Place a Mh3dCommand as a child of the Mh3d control with it's top, left , and bottom just inside of the inner bevel of the Mh3d control and its .Width set to 0. Set the .Picture property of the Mh3dCommand to WINLOGO.BMP, set the .WallPaper property to 2 - Replicate, set the .FontStyle property to 3 - Lowered, and set the .Alignment property to 2 - Center. Now add this function to a global module:
 Sub SetGauge (Ctrl1 As MhThreed, _ 
Ctrl2 As Mh3dCommand, percent As Integer) 

MaxWidth = Ctrl1.Width - (Ctrl2.Left * 2) 
Ctrl2.Width = MaxWidth * percent / 100 
Ctrl2.Caption = Str$(percent) + "%" 

End Sub 
You can call this function to set the % fill on the gauge from anywhere. The end effect is a gauge that appears to be engraved in marble. You can use your own bitmaps for other textures such as wood and granite.
MicroHelp Tech
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date