Results 1 to 3 of 3

Thread: [RESOLVED] Transparent Forms?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2009
    Posts
    27

    Resolved [RESOLVED] Transparent Forms?

    Hi,

    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.

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Transparent Forms?

    I don't see this behavior.

    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.
    Attached Images Attached Images  

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2009
    Posts
    27

    Re: Transparent Forms?

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width