 |
 |

08-30-2003, 12:44 AM
|
|
Centurion
|
|
Join Date: Feb 2003
Posts: 188
|
|
how to change progress bar color?
|
in win9x, the progress bar color is blue. how to change it to other color?
and also winXP?
|
|

08-30-2003, 12:48 AM
|
 |
Regular
|
|
Join Date: Aug 2003
Location: Perth, Western Australia
Posts: 78
|
|
__________________
poedguy
"Trust your Technolust"
|

08-30-2003, 11:19 PM
|
 |
Senior Contributor
|
|
Join Date: Jul 2003
Location: Stratford
Posts: 919
|
|
|
Actually, if you want a solid color, you can place a Label (.Caption = "") inside a PictureBox. Just stretch the PictureBox to whatever you want the maximum value/width to be, stretch the Label to match, then set the BackColor. Remember to set the Label's Top and Left to 0. To use it, just resize the PictureBox's width without sizing the Label. It's flicker-free, and you can also use a graphic to emulate the XP ProgressBar in every OS environment.
|
|

08-31-2003, 06:44 AM
|
 |
Strange Brewer
Retired Moderator * Guru *
|
|
Join Date: Jun 2001
Location: AddressOf Insomnia
Posts: 2,815
|
|
Quote: Originally Posted by poedguy there is no way to change it with the common controls,
That's totally wrong.
You can use the SendMessage API and PBM_SETBARCOLOR and PBM_SETBKCOLOR to change them.
The miracles of MSDN. 
|
__________________
"The lights below
You know they'll bleed forever
Get back as the cores blow
Let me fall..." - Dismantled, "Cornered"
|

09-01-2003, 07:22 PM
|
|
Centurion
|
|
Join Date: Feb 2003
Posts: 188
|
|
Quote: Originally Posted by Garrett Sever
Quote: Originally Posted by poedguy there is no way to change it with the common controls,
That's totally wrong.
You can use the SendMessage API and PBM_SETBARCOLOR and PBM_SETBKCOLOR to change them.
The miracles of MSDN. 
im not that advanced. but Photovoltaic idea is easy for me. thanks.
i will try pbm_setbarcolor & pbm_setbccolor. thanks.
|
|

09-01-2003, 08:03 PM
|
 |
Obsessive OPtimizer
Administrator * Guru *
|
|
Join Date: Jun 2002
Location: Debug Window
Posts: 13,685
|
|
|

09-02-2003, 03:11 AM
|
 |
Contributor
|
|
Join Date: May 2003
Location: Newt Galaxy
Posts: 542
|
|
Code:
Function picture_Bar(ByRef startx, ByRef endx, ByVal Couleur As Long)
Dim Ybar!, X!
For X = startx To endx
For Ybar = 0 To Picturebar.ScaleHeight
Picturebar.PSet (X, Ybar), Couleur
Next Ybar
Next X
DoEvents
End Function
' Usage:
'initialise startx and endx
'if only to follow progression of a single operation startx = 0
'but you can have startx take last value of previous operation
Call picture_Bar(startx, endx, vbWhite)
|
__________________
Life is a beach !
|

09-02-2003, 03:02 PM
|
 |
Obsessive OPtimizer
Administrator * Guru *
|
|
Join Date: Jun 2002
Location: Debug Window
Posts: 13,685
|
|
|
PSet? Why not use Line? Check out the URL I posted.
|
|

09-03-2003, 01:36 AM
|
 |
Contributor
|
|
Join Date: May 2003
Location: Newt Galaxy
Posts: 542
|
|
|
I use Pset because it allows me in some progressbars to insert percentage in the middle of bar and invert font colors so that percentage is visible all the time ...
|
__________________
Life is a beach !
|

09-03-2003, 10:05 AM
|
|
Iron-Fisted Programmer
Retired Moderator * Guru *
|
|
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
|
|
|
I don't see where you are doing any of those things in this example.
|
|

09-03-2003, 10:22 AM
|
 |
Obsessive OPtimizer
Administrator * Guru *
|
|
Join Date: Jun 2002
Location: Debug Window
Posts: 13,685
|
|
|
Spacefrog,
The code I posted does invert the colors for the percentage, and it's also centered in the picturebox.
Also, if you'd like a different color for the bar, just change the FillColor and ForeColor of the picturebox.
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|