Solved

SSPanel.FloodPercent

Posted on 1997-10-12
1
631 Views
Last Modified: 2011-10-03
I'm using VB 4.0.

I'm using a SSPanel to show how many percent of my database is sorted.
I want to automatic change color on the percent when the floodmeter comes over it.
Ex. FloodColor is blue. When the meter comes over the percent I want it to change the color of the first digit in the percent to white and so on.
I don't want to change the forecolor for the whole SSPanel. Just one digit at one time, depending on the floodmeters position.

Hope you understand my question.
0
Comment
Question by:a96parbr
1 Comment
 
LVL 1

Accepted Solution

by:
lmarceau earned 100 total points
ID: 1437349
The SSPanel won't allow you to do want you want to do. Want you have seen is all it has to offer. Furtermore, changing one digit at would not create the effect you want to create: the same effect as with most setup porgram where the digit change color one pixel colum at time.

There are two easy ways to do that.
One, make the background of a picture box white, the numbers dark blue  (&H800000) and the bar also blue. But paint the with a nxor drawmode (drawmode =10). With that effect, the dark blue will turn into white and the white will turn into dark blue. It won't work with any other combinison of color, just white and dark blue. If you want the full code go check the vb\setupkit\setup1\setup1.bas file and look at the function UpdateStatus.

Second way, which can handle any color is to place one picture box on your form with the desired background color (let say vbButtonTop) and the 3d effect turned on. Set the foreground color to the color of the text we the % is under 50 (let say vbWindowText). That will be your picProgressBox.

Then inside it, place another picturebox, no 3d effects, no borders, and select the chosen backgound color for the bar (let say vbHighlight). Set the foreground color to the color of the text after 50% (let say vbHighlightText). That will be your picProgressBar.

Assure that picProgressBar is INSIDE picProgressBox.
set the position of picProgressBar to: top=0 left=0 height=picProgressBox.ScaleHeight, widht= 0
(Make them both the same height)

Now, to make it happen, just widthen picProgressBar from 0 to picProgressBox.Scalewidth. this will make the progress bar walk toward the left. And the last step is to print the percent value at the same place in both picturebox: print it in picProgressBar AND in picProgressBox. This will do the trick.

Try it, it works wonder! It gives a nice progress bar watever the system color are set to.






0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now