Announcement

Collapse
No announcement yet.

Skinning .NET Applications made easy

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Skinning .NET Applications made easy

    Hi Folks,

    I've just assembled a sample to show you how easy you can add skinning to a .NET application using zControls and VisualDesigner and a few lines of code.
    Here's a screenshot:


    And here's the sample (C#) code: SkinningApp

    Note: In order to run this sample (or zControls in general), you need to have installed Managed DirectX SDK.
    Skinning to go... VisualDesigner2!

  • #2
    Zorro,

    Would this skin allow the use of say, reading in master volume level and displaying it in a transparent form label when the volume has changed, like a popup onscreen display? this would negate the need to show a volume percentage on most all skins for all frontends. some soundblaster cards have this ability built in, but i'm using onboard sound and was going to find a class for it for vb or c# and code this application myself, however if your class and visual skinning app allows for this already, that would be great.
    replicant
    Audi A4 (flickr pics)

    Comment


    • #3
      What you need has nothing to do with skinning.
      For your example one needs a transparent form and a color code for the bars the rest is reading and setting the volume information.

      If you're looking for such app, install MouseWheelInput and double click the mouse wheel.

      If you're looking for the audio stuff code, have a look here: http://www.codeproject.com/useritems/AudioLib.asp

      If you're looking for the code to paint such a bar, here it is:
      Code:
      private void Form1_Paint(object sender, PaintEventArgs e)
      {
      	SolidBrush brush = new SolidBrush( this.ForeColor );
      	Pen pen = new Pen(brush, 2f);
      	int width = this.Width / 20;
      
      	for(int i=0; i< 20; i++)
      	{
      		if( volume >= i)
      		{
      			e.Graphics.FillRectangle(brush, 1+i * width, 1, width - 3, this.Height - 2);
      		}
      		else
      		{
      			e.Graphics.DrawRectangle(pen, 1 + i * width, 1, width - 3, this.Height - 2);
      		}
      	}
      	brush.Dispose();
      	pen.Dispose();
      }
      Skinning to go... VisualDesigner2!

      Comment


      • #4
        haha, thanks man, i just posted a thread in the root of this particular forum section before seeing you posted this.
        replicant
        Audi A4 (flickr pics)

        Comment

        Working...
        X