|
-
Sep 13th, 2005, 01:58 AM
#1
Thread Starter
Lively Member
[RESOLVED] button property
I'm not too sure is I should put this thread here, but anyway, referring to the 2 screenshots below, is it possible to have a button which has a much rounded edges, (in VB .NET) rather than having those edges which looks sharper?
If it's possible, which property do I use? or how to do so?
thks,
FYRe
sOMEONE'S gONNA dO iT, wHY nOT yOU ?
-
Sep 13th, 2005, 02:43 AM
#2
Re: button property
You need to enable visual styles to give your controls that WinXP look. You need to give your app a Main method and put code something like this within it:
VB Code:
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New Form1)
You would also need to set the FlatStyle property of any control that supports it to System.
Note that are several short-comings in the visual style support provided by VS.NET 2003. These have been addressed in VS 2005, but for now you cannot place an image on a themed button, NumericUpDown controls do not support visual styles at all, TabControls do not display the correct BackColor, and various other things. To overcome these issues you could download the free Skybound VisualStyles component, that fixes the theme support for existing controls, or you could use inherited controls like those in the free Quantum Windows Forms Components library.
-
Sep 13th, 2005, 02:52 AM
#3
Thread Starter
Lively Member
Re: button property
Is there any possible way that need not require any downloading ?
sOMEONE'S gONNA dO iT, wHY nOT yOU ?
-
Sep 13th, 2005, 03:11 AM
#4
Re: button property
You can enable visual styles with just those lines of code I posted. No need to download anything. The issues arise when you want to do things that are not supported, like put an image on a button. That's when you'd need to download something.
-
Sep 13th, 2005, 03:43 AM
#5
Thread Starter
Lively Member
Re: button property
 Originally Posted by jmcilhinney
You need to enable visual styles to give your controls that WinXP look. You need to give your app a Main method and put code something like this within it:
VB Code:
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New Form1)
You would also need to set the FlatStyle property of any control that supports it to System.
Note that are several short-comings in the visual style support provided by VS.NET 2003. These have been addressed in VS 2005, but for now you cannot place an image on a themed button, NumericUpDown controls do not support visual styles at all, TabControls do not display the correct BackColor, and various other things. To overcome these issues you could download the free Skybound VisualStyles component, that fixes the theme support for existing controls, or you could use inherited controls like those in the free Quantum Windows Forms Components library.
Where do I exactly place the following lines of codes?
in a function? or MainForm_Load? or somewhere else?
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New Form1)
thks,
FYRe
sOMEONE'S gONNA dO iT, wHY nOT yOU ?
-
Sep 13th, 2005, 03:54 AM
#6
Re: button property
Am I posting in some other language today?
 Originally Posted by jmcilhinney
You need to give your app a Main method
-
Sep 13th, 2005, 03:58 AM
#7
Re: button property
OK... maybe you haven't come across a Main method before. Many people put them in a module, but unless you are using a module for something else already then there's no point. Just put this in your main form:
VB Code:
Shared Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New Form1)
End Sub
If your main form is not called Form1 then make the change accordingly. This method will now be the entry point for your app, i.e. the first code executed.
-
Sep 13th, 2005, 04:04 AM
#8
Thread Starter
Lively Member
Re: button property
Jm, I'm perfectly new to VB .NET. I picked up this language just like abt 2 months ago for my 3 month project in sch u know... (obviously you don't). And on top of all, I'll be having a presentation soon.
So, pls, be a gd samaritian (which you have always been and will always) and help me out. What I'm trying to say is to explain to me in "layman's term".
Ever since I became a member of this forum, I really do appreciate you help.
thks man,
So, back to my question: Where?
FYRe
sOMEONE'S gONNA dO iT, wHY nOT yOU ?
-
Sep 13th, 2005, 04:18 AM
#9
Re: button property
Hmmm...
 Originally Posted by jmcilhinney
Just put this in your main form:
VB Code:
Shared Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New Form1)
End Sub
-
Sep 13th, 2005, 04:27 AM
#10
Thread Starter
Lively Member
Re: button property
I guess, I didn't refresh my IE or was it that you and I wrote at the same time and submitted at the same time
sorry....
thks anyway.
I placed the code you posted, however, the only difference when I run my form is the ComboBox and the NumericUpDown change to the XP style, but not the buttons.
???
sOMEONE'S gONNA dO iT, wHY nOT yOU ?
-
Sep 13th, 2005, 04:37 AM
#11
Re: button property
 Originally Posted by jmcilhinney
You would also need to set the FlatStyle property of any control that supports it to System.
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
|