Results 1 to 2 of 2

Thread: VB.Net XP Styles How To

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    VB.Net XP Styles How To

    To create XP styles in a .net program is very simple...follow these steps and you can learn how:

    first, you need to add this sub inside the form class:
    VB Code:
    1. <System.STAThread()> _
    2.         Public Shared Sub Main()
    3.  
    4.             System.Windows.Forms.Application.EnableVisualStyles()
    5.             System.Windows.Forms.Application.Run(New Form1) ' Change Form1 the the name of your Form
    6.         End Sub
    then, you just add this to each control you want to transform into an XP style:
    VB Code:
    1. FlatStyle = System.Windows.Forms.FlatStyle.System
    Keep in mind that some won't NEED to have that appended because they are going to transform now by default. You will just have to try that code and see.

    you can pick from three other style besides System

    Check out and play with the sample project to see this...you will notice that when in design mode, the controls look normal but when you run, the controls take on a different look...the ones you see at first are like that by default now and when you click on the actual form, the ones that STILL look normal will change...I did this to demonstrate how you can do this on the fly.
    Attached Files Attached Files
    Last edited by Andy; Jul 1st, 2005 at 02:11 PM.

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