Hi ,
I am calling SetWIndowTheme( ) in the InitializeComponent() , and then add
the DLL to my form - the look is proper ( like Windows 2000 ).
But when I start the progress bar using the following code . the theme color
reverts back to XP .
MY COMPONENT
// Progress Bar Component
InitializeComponent ()
{
Core.SetWindowsTheme(myprogressbar.handle, " " , " " )
}
void StartProgessBar ( )
{
myprogressbar.Step = 30;
myprogressbar.PerformStep( ) ;
}
WINDOWS FORMS
// WIndows Forms generated Code
// with EnableVisualStyles
// OnClickButton
{
// Start the progressbar
myProgressMeterComponent.StartProgessBar( );
// I get the XP look again
}
Am I going wrong somewhere .
Please let me know.
Thanks ,
Sujay
--
Sujay Ghosh
Bangalore, INDIA
[quoted text, click to view] "Herfried K. Wagner [MVP]" wrote:
> "Sujay Ghosh" <SujayGhosh@discussions.microsoft.com> schrieb:
> > Environment : .NET 2.0 / VS2005
> >
> > I am creating a usercontrol ( progressbar ) and every time I add my
> > control
> > to the project it gives a XP progress bar because of the
> > EnableVisualStyles
> > function .
> >
> > I want to suppress the EnableVisualStyles from within my component .
> >
> > I want the normal Windows 2000 look .
>
> P/invoke with the 'SetWindowTheme' function can be used to disable Windows
> XP visual styles for a certain window.
>
> --
> M S Herfried K. Wagner
> M V P <URL:
http://dotnet.mvps.org/> > V B <URL:
http://dotnet.mvps.org/dotnet/faqs/> >