locked
How to enable visual styles on my settings tab? RRS feed

  • Question

  •  

    I have updated to .net framework 2.0 but I don't know how to enable visual styles in my application. Should I use Application.EnableVisualStyles?

     

    Code Snippet

    public SampleControl(int width, int height)
      {

        Application.EnableVisualStyles();

     

        Panel frame = new Panel();
          frame.BorderStyle = BorderStyle.FixedSingle;
          frame.SetBounds(0, 0, width, height);
          frame.Parent = this;  

      

        Btest.BackColor = Color.LightGray;
          Btest.Text = "TEST";
          Btest.Location = new Point(243, 183);
          Btest.Size = new Size(127, 36); 
          Btest.FlatStyle = FlatStyle.System;
          Btest.Click += new System.EventHandler(this.Btest_Click);
          frame.Controls.Add(Btest);

        .....

    }

     

     

    Monday, July 2, 2007 9:08 AM

Answers

  • Hi!

    Since WHS is based on Windows Server 2003, there are no visual styles available and the controls you get from System.Windows.Forms namespace will have the old-fashioned look.

    But in HomeServerControls.dll there are some very nice controls that have the vista-style, e.g. for a button you have to use the Microsoft.HomeServer.Controls.QButton control.

    Look at it and you will see Smile

    Greets, Alex

    Monday, July 2, 2007 11:19 AM

All replies

  • Hi!

    Since WHS is based on Windows Server 2003, there are no visual styles available and the controls you get from System.Windows.Forms namespace will have the old-fashioned look.

    But in HomeServerControls.dll there are some very nice controls that have the vista-style, e.g. for a button you have to use the Microsoft.HomeServer.Controls.QButton control.

    Look at it and you will see Smile

    Greets, Alex

    Monday, July 2, 2007 11:19 AM
  •  

    Hi, Alex Greets

     

        Thanks for your precious suggestion. You give me a great help.

     

    Monday, July 2, 2007 11:37 AM
  • But don't forget that some of your users won't be using Vista!

     

    Colin

    Monday, July 2, 2007 4:58 PM