• 0

[Vb.Net] How to Skin a form


Question

Hello all ..

I'm sorry but I'm new to VB.Net .. so this is my question

How can I skin a form without using Transparecykey (because I tried to used.. and didn't function)..

I search the web for aswers.. but it is only in VB6 .. or other than vb.Net

THanks for who says something :)

PS: Sorry for my english :)

Link to comment
Share on other sites

18 answers to this question

Recommended Posts

  • 0

saw that, done that .. didn't help much.. :)

because when I tried TransparentKey It didn't work..

and yes it was the same color that i wanted to be transparent..

but thanks anyway :)

Link to comment
Share on other sites

  • 0

The VB 6 stuff still applies, except, with .NET it's easier to subclass since you can override the WndProc for your form. Check out VBAccelerator.com.

Link to comment
Share on other sites

  • 0

You want a free form skin? Because I got those sort of working (no alpha support) in my app finally after months of working on it. It's actually pretty simple. Set the form color to magenta, set the trans key to magenta and then apply a png or gif with transparency on it. Again, it does not give you alpha channel support, but it does do it.

Link to comment
Share on other sites

  • 0

Thanks for all.. I started searching the web and found something :))

ehhehe

using the transparentkey as the first pixel of the bmp.. :))

and its working ehhehe

Link to comment
Share on other sites

  • 0

i was using the transparentkey thing in C#, it was working fine but i can't use a transparent PNG (or a GIF)

anyone know how i would work that out?

Link to comment
Share on other sites

  • 0
i was using the transparentkey thing in C#, it was working fine but i can't use a transparent PNG (or a GIF)

anyone know how i would work that out?

As I said above, what I did was this:

I apply magenta as the backcolor of the form. Then, I set the form's transparency key to magenta also. Now, I simple use the following code in the paint event of my form:

   Private Sub FormNote1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
        Me.BackgroundImage = Nothing
        Dim g As Graphics = e.Graphics
        background = Image.FromFile("background.png")
        Dim r As Rectangle = New Rectangle(0, 0, background.Width, background.Height)
        g.DrawImage(background, Me.ClientRectangle)
    End Sub

I cleaned it up a bit, because I had some path variables in there and such, but that's the gist of it.

Link to comment
Share on other sites

  • 0

I've never been able to understand GDI+ enough to handle the alpha blended edges. It's the same problem I still have. I would love to know how though.

Link to comment
Share on other sites

  • 0

thanks man, it's a start but what I'm doing in the paint event already is similar to that. I'm going ot need to find something about using images. I just need time.

Link to comment
Share on other sites

  • 0

I have the same thing, but it uses 2000 and xp native window transperancy, so it is hardware accelerated on some systems.

I got it off codeproject.com, it's called per-pixel alpha form (or something)

Link to comment
Share on other sites

This topic is now closed to further replies.