* "Steven Smith" <an*******@disc ussions.microso ft.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.prgSplashScr een.ForeColor = Color.Gold()
&
Me.prgSplashScr een.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.EventArg s _
) 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>