I'm having a few problems creating a transparent form. The reason I want to do this is because I'm attempting to make a custom border (one that isn't exactly square).
I can already get the form to be transparent, then I set my custom background image, which all works perfect, it even detects when the mouse enters the image, which is great. (I use transparency key to make the form transparent)
The problem is, if I add ANY control, or even if I just save the file, NOTHING else, the whole thing has a spaz attack.. Instead of having the image with the transparent form, the square form appears every time I run the app. What the hell?
Is this just some VB glitch? Or am I doing something wrong? Any help will be greatly appreciated.
Here is a simple form with borderstyle set to 0, with a transparency key set to lime. The form has a backcolor of lime as well so it will be transparent. There is a round red circle which is just a GIF image, set to the forms background image property, and the backgroundimage layout is set to center.
The left is in the IDE, the right is when I run the app.
Okay, that's wierd, I did EXACTLY what you did, but used a .png image, now that I've converted it to .gif, it seems to work. Also, I have to set the background to none, and under the form load sub, manually set the BG in code, otherwise I get the same problem. But I can deal with that as long as this works.
Well I'll experiment with this a bit more and see what happens. If I get no problems I'll mark this as resolved. Thanks mate!
EDIT:
Got this far, and...
I had a genius idea. Leave the form with no background, add panel, dock the panel to fill the form, set the panels back color to transparent, with the background image, and wallah! Still don't get why it didn't work in the first place though..
Thanks for all your help, mate.
Last edited by Mysterious2k9; Dec 4th, 2009 at 10:05 AM.