Results 1 to 8 of 8

Thread: Progressbar XP Style?

  1. #1

    Thread Starter
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575

    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

  2. #2
    Hyperactive Member
    Join Date
    May 2002
    Location
    Wisconsin, USA
    Posts
    279
    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

  3. #3

    Thread Starter
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575
    hmm.... didn't have any effect... me very clueless

  4. #4
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    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:
    1. Public Shared Sub Main()
    2.  
    3. System.Windows.Forms.Application.EnableVisualStyles()
    4. System.Windows.Forms.Application.Run(New Form1)
    5.  
    6. 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

  5. #5

    Thread Starter
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575
    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

  6. #6
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    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 Attached Files

  7. #7

    Thread Starter
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575
    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

  8. #8
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    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
  •  



Click Here to Expand Forum to Full Width