Skip to main content
GameDev.net gamedev.net
🔒 Locked

[.net] Custom skinning C# elements?

Started by neonic Apr 27, 2008 at 4:05 AM 1 replies 1.3k views
Original Post
neonic
neonic
I remember seeing a video on an MSDN blog a while back that said there was a new feature to allow extremely easy skinning of a control via a thing (I believe called) templates? Basically it is an XML file that declares what objects are what colors/shapes/etc. For the life of me, I can't find that video or see really any mention to it in the 3.5 framework included in VS2008. What I am basically trying to do is change the look of the TreeView element. I have been overriding the OnPaint method to provide what I need, but it is very tricky and I have been getting weird issues with it as well. - Mick O.
alex_myrpg
alex_myrpg
From what you're saying, I think you're referring to WPF (Windows Presentation Foundation) there, which is new to .NET 3.5 and VS 2008, and is the successor to Windows Forms. It also seems that you're trying to skin a Windows Forms control, which would be no easier than in .NET 2.0 / VS 2005 of course. (You would indeed have to override the OnPaint and other methods and change some of display properties of the control.)

I recommend you read this and/or this to get started with WPF (there's a Themes and Skins section near the bottom of the page). Finally, this sample should also be of use.
Hope that helps...

[Edited by - alex_myrpg on April 28, 2008 1:32:10 PM]
neonic
neonic
Quote:
Hope that helps...


I can't tell you how much it really did. That is Exactly what I was looking for and it will almost positively make my life one whole hell of a lot easier!

Thanks!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.