473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Progressbar control

is it possible to change the color of the step blocks
from the default blue which are incremented in the
progressbar control or is this goverened by windows ?

I tried

Me.prgSplashScreen.ForeColor = Color.Gold()

&

Me.prgSplashScreen.BackColor = Color.Gold()

with no success or obivious results
can anyone enlighten me on this subject

thanks in advance
regards steve
Nov 20 '05 #1
2 1237
* "Steven Smith" <an*******@discussions.microsoft.com> scripsit:
is it possible to change the color of the step blocks
from the default blue which are incremented in the
progressbar control or is this goverened by windows ?

I tried

Me.prgSplashScreen.ForeColor = Color.Gold()

&

Me.prgSplashScreen.BackColor = Color.Gold()

with no success or obivious results
can anyone enlighten me on this subject


Quick and _very_ dirty:

\\\
Private Declare Auto Function SendMessage Lib "user32.dll" ( _
ByVal hwnd As IntPtr, _
ByVal wMsg As Int32, _
ByVal wParam As Int32, _
ByVal lParam As Int32 _
) As Int32

Private Sub PbSetForeColor( _
ByVal Pb As ProgressBar, _
ByVal NewColor As Int32 _
)
SendMessage(Pb.Handle, &H2001, 0, NewColor)
End Sub

Private Sub PbSetBackColor( _
ByVal Pb As ProgressBar, _
ByVal NewColor As Int32 _
)
SendMessage(Pb.Handle, &H409, 0, NewColor)
End Sub

Private Sub Form1_Load( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs _
) Handles MyBase.Load
PbSetForeColor(Me.ProgressBar1, RGB(255, 0, 0)) ' Rot.
PbSetBackColor(Me.ProgressBar1, RGB(0, 0, 255)) ' Blau.
Me.ProgressBar1.Minimum = 0
Me.ProgressBar1.Maximum = 100
Me.ProgressBar1.Value = 50
End Sub
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Nice one Herfried, thats spot on, serves the purpose well

Thanks again

Regards Steve
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Maka Sili | last post by:
Using ProgressBar.Enabled = false does not dim the progress bar. There must be a way. I hope somebody could guide me. Thanks.
1
by: Geir Baardsen | last post by:
Hi! Is there any clear examples on how to use the Progressbar (6.0) in ms access 2000 anywhere? Me.Name
2
by: Thomas Kehl | last post by:
Hi! Does anyone have a tipp for me where can I found (or how can I programm) a "progressbar" which has a gradient and the color go from the left side to right and back ... I should have a...
3
by: Rene Sørensen | last post by:
Hi Is there a way to show text in/over a progressbar (like using a label with transparent background? Which hasn't worked for me, BTW)??? Rene
8
by: needin4mation | last post by:
Please consider: foreach (ListViewItem item in listViewFiles.Items) { // Display the ProgressBar control. pBar1.Visible = true; // Set Minimum to 1 to represent the first file being copied....
1
by: Mehr H | last post by:
I've been trying to figure out how i can embed a Windows.Forms.ProgressBar in my webform (aspx) file. I have tried putting a Windows.Forms.ProgressBar as public on a regular winform designer form...
2
by: Bill Nguyen | last post by:
How can I create a shared function to display process progress that can be called from other routines within an application? Any example that I can follow? Thanks Bill
3
by: Mitchell Vincent | last post by:
In other programming languages I've been able to easily change the style of a progress bar between smooth and blocked. I find that is either really hidden or impossible in .NET. Am I missing...
2
by: =?Utf-8?B?QWFyb24=?= | last post by:
Since some controls such as the DataGridView take a long time to update themselves when performing certain tasks, I have added a StatusStrip with a ProgressBar on it. While I am updating the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.