Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 10th, 2004, 04:31 AM
Authorized User
 
Join Date: Feb 2004
Location: Sofia, , Bulgaria.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Windows XP controls

Hello,

i am trying to create a windows form, using windows XP looking-like controls, like buttons displaying a yellow frame when the mouse goes over them. I am using Windows XP and Visual Studio 7. I create a C# Windows Application project and add Windows Forms controls. I can't find properties configuration making the controls look like Windows XP ones(like AutoCAD 2004 controls for instance). I'm not sure if it is up to props.

If someone can give me advise how to achieve my goal i'll be verry thankful.

Alexander Panov



Reply With Quote
  #2 (permalink)  
Old April 10th, 2004, 05:54 AM
Authorized User
 
Join Date: Jun 2003
Location: Norfolk, , United Kingdom.
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Alexander

The standard windows controls in .net do not allow for this type of styling. I would suggest a third party control, infragistics do some great controls and are competitively priced, saves a lot of time writing them yourself.





Duncan
Reply With Quote
  #3 (permalink)  
Old April 10th, 2004, 01:03 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

You would have to create the images yourself in a graphics program like Freehand/Fireworks or Photoshop, but once that is done you can use the "BackGroundImage" property of the button to set the image you want in MouseEnter and MouseLeave events of the button.

J
Reply With Quote
  #4 (permalink)  
Old April 10th, 2004, 02:18 PM
Authorized User
 
Join Date: Feb 2004
Location: Sofia, , Bulgaria.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

thanks for your answers. I suspected these ways of doing it - using another control library or create the images yourself. What puzzles me though, is that some applications or web pages, when running on Windows XP look one way and another when running on windows 2000 for example. It looks to me like these applications inherit the controls styles from the OS. But the form i create doesn't do that.

Thanks a lot once more.

Alex

Reply With Quote
  #5 (permalink)  
Old April 10th, 2004, 06:00 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Alex,

You'll need to enable visual styles before your application can use them. Check out the following two MSDN articles for more info:

http://msdn.microsoft.com/library/de...x/cookbook.asp

http://msdn.microsoft.com/library/de...ndowsForms.asp

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: The Beautiful Ones by Prince and the Revolution (Track 3 from the album: Purple Rain)

Reply With Quote
  #6 (permalink)  
Old April 11th, 2004, 03:39 AM
Authorized User
 
Join Date: Feb 2004
Location: Sofia, , Bulgaria.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'll read the articles Imar. Thank you very much.

Alex

Reply With Quote
  #7 (permalink)  
Old April 11th, 2004, 03:02 PM
Authorized User
 
Join Date: Feb 2004
Location: Sofia, , Bulgaria.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The articles are exactly what i needed. I done the job. Thanks a lot Imar.

Reply With Quote
  #8 (permalink)  
Old April 12th, 2004, 05:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Hudson, MA, USA.
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Note that Version 1.1 of the .NET framework added a new method to the Application object called 'EnableVisualStyles'. You place a call to this method in your Sub Main; it can be used as an alternative to using a manifest as the articles require.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
Reply With Quote
  #9 (permalink)  
Old April 12th, 2004, 11:31 AM
Authorized User
 
Join Date: Feb 2004
Location: Sofia, , Bulgaria.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well,

it also works, and I find this way of enabling visual styles more appropriate for my case. Thanks a lot Jeff.

Alex

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controls and button style Windows Xp TAVOSOFT Pro VB.NET 2002/2003 1 July 21st, 2004 08:28 AM
Windows XP btls Wrox Book Feedback 1 July 13th, 2004 02:41 PM
Controls and button style Windows XP TAVOSOFT VB.NET 1 June 12th, 2004 09:59 AM
Controls and Button style Windows Xp TAVOSOFT VB.NET 2002/2003 Basics 1 June 12th, 2004 08:53 AM
Windows 98 OCX control issues vs Windows XP benoyraj VB How-To 0 May 5th, 2004 08:10 AM



All times are GMT -4. The time now is 05:02 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.