devxlogo

Make a Gauge with MicroHelp’s Controls

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 insideof the outer bevel. Place a Mh3dCommand as a child of the Mh3d controlwith it’s top, left , and bottom just inside of the inner bevel of theMh3d control and its .Width set to 0. Set the .Picture property of theMh3dCommand to WINLOGO.BMP, set the .WallPaper property to 2 – Replicate,set the .FontStyle property to 3 – Lowered, and set the .Alignment propertyto 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 fromanywhere. 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.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist