Question

I want to skin a vb.net app I made ive googled some stuff and I've seen skinned vb.net apps.

However it seems like any time i try to find someone explaining it its a link to a pay for product.

Does anyone have anything useful on this?


I have seen some free ways to do this programatically I cannot seem to make it translate entirely over to my own unique program.

Was it helpful?

Solution

I remember making a "skinnable" vb.net winforms app (a media player) when I was still a student (maybe 6 years ago).

It was ugly, but the way I did it was as follows:

  1. Select a transparency color. Wherever you use this color the app will be transparent (I used Fuchsia (#FF00FF), which I recall being a standard for video games back in the day.

  2. Use a naming convention for child controls (particular buttons, sliders, etc).

  3. Create images for the controls in step 2.

  4. Set 1 pixel wide color coated place holders for those controls. Eg a blue pixel was my play button, a green pixel was my pause button, etc. The placeholder marked the upper left corner of the control.

  5. At runtime dynamically generate the controls (really images with onclick events) and place them on top of the place holders.

I'm sure there is a nicer way to do this, but that was my crude approach.

OTHER TIPS

I'm more of a hobbyist, but this is how you might do it: Make a class that must be initialized with a winform and the path to a "settings file". From the constructor:

  1. Read in a settings file (I'd just make up something in XML)
  2. Loop through all the controls on said winform and apply the fore/back colors, pictures, opacity, etc. as specified by said settings file.
  3. Just instantiate the class in all your forms.

Might be a better way, but that was pretty much what I did the last time I was at it. Usually I specify a "style" for each type of control, textbox, combobox etc. and then allow for special cases by using the tag's control property.

Not sure how helpful that is.

Unfortunatly VB.NET does not provide 'skinning' out of the box. It simply uses the standard windows interface. The only changes to the UI are made when you change the display properties.

I'm not aware of an open source project that provides skinning functionality, however I have used a number of commercial products. By far, one of the best I have used is the Application Styling Framework found in NET Advantage by Infragistics.

As the previous answers have stated, vanilla VB is a pain to do this in but there is a free alternative (in VB still). Unfortunately it will involve you learning a lot of stuff and rewriting your app to work with WPF (Windows Presentation Foundation).

Put simply WPF is a replacement for WinForms (which you are probably using now). The main difference being that WPF is vector based and resolution independent whilst WinForms is bitmap based. The output of WPF looks great but it is a lot to learn.

You can easily skin a WPF app and the Microsoft samples show you how to do this too. Using WPF may limit the systems you can install on as it needs .Net 3.0 (best to use 3.0 SP1 or 3.5 SP1 if you can).

A quick Google for WPF and skinning shows a lot of promise.

Ryan

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top