Jul 24th, 2004, 07:30 AM
#1
Thread Starter
Fanatic Member
Progressbar XP Style?
Hi,
I just noticed the Progressbar control doesn't have a flatstyle so I can't set it to System.
How do I get this effect on the control?
Thanks
Jul 25th, 2004, 11:00 PM
#2
Hyperactive Member
Add the bold line of code to the New() sub of your form.
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
Application.EnableVisualStyles()
End Sub
Jul 29th, 2004, 10:44 AM
#3
Thread Starter
Fanatic Member
hmm.... didn't have any effect... me very clueless
Jul 29th, 2004, 11:35 AM
#4
Frenzied Member
This has been answered in this forum before, but I can't find it. Searching for "EnableVisualStyles" brings up no results. But here's how you do it.
First:
VB Code:
Public Shared Sub Main()
System.Windows.Forms.Application.EnableVisualStyles()
System.Windows.Forms.Application.Run(New Form1)
End Sub
Then, for buttons and anything that has a FlatStyle property, set it to System instead of the default value of Standard.
HTH,
Mike
Jul 29th, 2004, 12:21 PM
#5
Thread Starter
Fanatic Member
didn't help... i haven't got a problem with anything else. my buttons and everything work fine. it's just the blasted progress bar
Jul 29th, 2004, 12:34 PM
#6
Frenzied Member
What version of VS are you using? Is it 2002? There's a different way to do it in 2002, if I remember correctly.
I attached a project for an example, but it is VS 2003. I did have to change the startup object to sub main instead of form1.
Mike
Attached Files
Jul 29th, 2004, 03:41 PM
#7
Thread Starter
Fanatic Member
hmm... i'm beginning to think it's probably WindowsBlinds doing it...
I don't see progress bars for some weird reason in .NET with WindowsBlinds on
Edit: Yeah, so it is.... i just got rid of windowsblinds, put the default xp style back on, and it shows now! How silly lol, oh well
Jul 29th, 2004, 03:47 PM
#8
I dont use any apps like that on my development PC because not only can things like that happen, but also you kind of develop the GUI for what looks good with your window blinds theme, and not with what 99% of the users will be looking at, which is windows with its default settings.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width