HRamos Posted May 25, 2004 Share Posted May 25, 2004 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 More sharing options...
0 Cool4 Posted May 25, 2004 Share Posted May 25, 2004 http://msdn.microsoft.com/vbasic/atthemovi...to/default.aspx i hope this helps ;) Link to comment Share on other sites More sharing options...
0 HRamos Posted May 25, 2004 Author Share Posted May 25, 2004 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 More sharing options...
0 azcodemonkey Posted May 25, 2004 Share Posted May 25, 2004 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 More sharing options...
0 bangbang023 Veteran Posted May 25, 2004 Veteran Share Posted May 25, 2004 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 More sharing options...
0 HRamos Posted May 26, 2004 Author Share Posted May 26, 2004 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 More sharing options...
0 Rudy Posted May 28, 2004 Share Posted May 28, 2004 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 More sharing options...
0 bangbang023 Veteran Posted May 28, 2004 Veteran Share Posted May 28, 2004 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 More sharing options...
0 Rudy Posted May 28, 2004 Share Posted May 28, 2004 oh ic so you have to load the background image at run time? thank you i will give it a shot Link to comment Share on other sites More sharing options...
0 Rudy Posted May 28, 2004 Share Posted May 28, 2004 it doesnt quite work, the png is displayed but the alpha blend is not displayed properly any ideas? Link to comment Share on other sites More sharing options...
0 bangbang023 Veteran Posted May 28, 2004 Veteran Share Posted May 28, 2004 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 More sharing options...
0 Rudy Posted May 28, 2004 Share Posted May 28, 2004 i guess i'll have to get rid of the alpha blended edges :( better than nothing though Link to comment Share on other sites More sharing options...
0 biorK Posted May 28, 2004 Share Posted May 28, 2004 Bangbang: Don't know if this helps.. but here ya go, some tutorials about GDI+ GDI+ for beginners GDI+ for beginners 2 Brushes in GDI+ Pens and fonts in GDI+ Link to comment Share on other sites More sharing options...
0 bangbang023 Veteran Posted May 29, 2004 Veteran Share Posted May 29, 2004 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 More sharing options...
0 Rudy Posted May 29, 2004 Share Posted May 29, 2004 biork: not bad but nothing about transparency Link to comment Share on other sites More sharing options...
0 HRamos Posted May 29, 2004 Author Share Posted May 29, 2004 I used a png with transparency on the back and I think it will do what i want :) The code I used its from a webpage, don't remember where, but its a bit long so i'll put in here -> http://hramos.dnip.net/public/clsIrregular.vb For me its doing fine.. like this Hope works for you :)) Link to comment Share on other sites More sharing options...
0 Rudy Posted June 6, 2004 Share Posted June 6, 2004 thats exactly what i want but i guess i'll have to figure out the equivalent in C# thanx :) Link to comment Share on other sites More sharing options...
0 Mordkanin Posted June 6, 2004 Share Posted June 6, 2004 A stargate fan. Yey! Link to comment Share on other sites More sharing options...
0 The_Decryptor Veteran Posted June 7, 2004 Veteran Share Posted June 7, 2004 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 More sharing options...
Question
HRamos
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