Jump to content
  • Advertisement
Sign in to follow this  
Synex

[.net] Skinning an application

This topic is 4840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to look for some tutorials on how to 'skin' an application. I'm writing a database application, but would like to spice up the graphics a bit by making the window controls look a bit different. (Examples would be Media Player 9 / Limewire etc) Any ideas? Programming in .NET & C#

Share this post


Link to post
Share on other sites
Advertisement
You can buy controls, like Infragistics. Otherwise I think it's pretty straight forward hard work if you're trying to make something snazzy from scratch. Probably will need a UI artist if you don't have that talent.

Share this post


Link to post
Share on other sites
sublcass each control you want to use and override the OnPaint method? It's filthy, but it's the only way... oh, wait, there was something about this in Visual Studio Magazine a little less than a year ago.


hmmm...


here is a link to some tools.
Everything else I see is about manually doing the painting yourself. Which isn't necessarily bad, it's just time consuming to write. I skinned Java MDI child frame widgets in this way to represent rooms in a building floor diagram.

Share this post


Link to post
Share on other sites
Quote:
Original post by krum
You can buy controls, like Infragistics. Otherwise I think it's pretty straight forward hard work if you're trying to make something snazzy from scratch. Probably will need a UI artist if you don't have that talent.


if my coworkers are to be believed (and they are pretty good), infragistics is the spawn of satan.

Share this post


Link to post
Share on other sites
I swear I saw an article on using a PictureBox to do skinning...I'll try to find it for you, see if I have it saved.

I know the background of the page was beige if that helps :p

Share this post


Link to post
Share on other sites
Well, i already wrote a GUI in DirectX, but didn't what to really use DirectX for a DB App, its a bit of over-kill, tho i bet i could do some cool things with 3D data visualization.

Back on topic! *slap slap*

Another good example would be Microsoft Money / MSN Messenger etc that use custom 'graphic' controls.

So a beige page eh? Maybe i'll google that and see what i can find...

Share this post


Link to post
Share on other sites
Quote:
Original post by Synex
Well, i already wrote a GUI in DirectX, but didn't what to really use DirectX for a DB App, its a bit of over-kill, tho i bet i could do some cool things with 3D data visualization.

Back on topic! *slap slap*

Another good example would be Microsoft Money / MSN Messenger etc that use custom 'graphic' controls.

So a beige page eh? Maybe i'll google that and see what i can find...

no, you would use GDI+, not DirectX

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hi,
My friend recently made an application skinning framework for .NET

Quote:

I've always wanted a skinning framework for .NET. Lately I've been getting good with custom drawing tasks, and I wanted to dive a little more into windows messages and that, and decided to take a crack at it. After a start in the right direction but some confusion, I stumbled across a blog entry that laid it out. After getting it working fairly well on the first run, I scrapped what I had and rewrote from the ground up.


http://www.jinxbot.net/pub/netskinex.jpg is a preview

Quote:

Above is a fairly full-featured skin designer program (it doesn't have Save, but it wouldn't be hard to do). All of the classes related to adding skin elements are marked Serializable, so pretty much all you need to do is make a call to the BinaryFormatter class.

There are two rendering base classes -- SkinElement and MultiStateSkinElement. They provide interfaces which any custom designer should implement. For example, there is an implementation of SkinElement called VectorSkinElement -- it allows you to define a GraphicsPath with any number of points with a given pen and brush.

I'm having some problems with some things:
* For whatever reason, when I press and hold a caption-bar button, it doesn't go into its "Pressed" state. Furthermore, if I move the mouse while I've got it down, it draws the Windows-equivalent button. Eww!
* Even more confounding is that the above behavior only happens in the debug version -- in the release version, when I roll the mouse off of the button it minimizes/maximizes/closes.
* The transparency key property shouldn't be used like I did (to make the transparent color part of the skin do its thing) -- I want to find another way to allow rounded edges and such.

Things I want to do with this still
This represents a week's worth of time at work (48 hours this week). It's still in its infancy.
* I want to be able to provide custom painting for any controls that are on the form.
* I want to make a Brush designer, so that (for example) the Title text, since Graphics.DrawString takes a Brush parameter, could be painted with a LinearGradientBrush.
* I need to implement the basic SkinElement designer window, which means I need to implement extensibility. The idea is that you could tack-on other .NET assemblies and use them as additional skin element renderers. The form that pops up when you click the "..." button in the skin designer is supposed to let you do that.
* I want to create a custom-drawn Menu framework (flat Office 2003-like menus) and provide a way for that to be integrated.

I'll be adding several properties and methods over the time ahead when I get to play with this, so don't expect me to worry about compatibility until I make an "official" release. The code I've posted is free to be used in whatever non-commercial means you wish, as will be true of any future releases I make. I also am welcome to any comments/criticisms you might have.

Code/binaries:
http://www.jinxbot.net/pub/netskinex.zip


Regards,
Nelson

Share this post


Link to post
Share on other sites
You're in luck!
I was downloading useful web pages after loads got corrupted due to me deleting them then recovering them while I was moving computers :( Then I found this!

Beige background ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!