CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 3 123 LastLast
Results 1 to 15 of 32
  1. #1
    Join Date
    Sep 2005
    Posts
    233

    Exclamation Form Transparency. Help!

    Hi,
    I am making an awesome media player that has rounded corners. What code can I use or what FREE activex control can I use to make the form transparent, except for the areas that are taken up by the media player?

  2. #2
    Join Date
    Oct 2005
    Location
    England
    Posts
    803

    Re: Form Transparency. Help!

    Quote Originally Posted by TCanuck42
    Hi,
    I am making an awesome media player that has rounded corners. What code can I use or what FREE activex control can I use to make the form transparent, except for the areas that are taken up by the media player?
    Search the forum for transparent forms there are tones of example using the setLayeredWindow API.
    Rich

    Visual Studio 2010 Professional | Windows 7 (x64)
    Ubuntu

  3. #3
    Join Date
    Sep 2005
    Posts
    233

    Re: Form Transparency. Help!

    I searched but found nothing that helped me. I need code that makes a form transparent, but not the objects and controls. Please respond asap.

  4. #4
    Join Date
    Mar 2005
    Location
    Nottingham, UK
    Posts
    665

    Re: Form Transparency. Help!

    Try this thread which should provide a solution using the SetLayeredWindowAttributes API. Only works on Win 2000/XP though. In that thread I posted a link to an excellent two part tutorial for using this API.
    (\/)
    (-.-)
    (')(')


    Bunny's quest for world domination continues.

  5. #5
    Join Date
    Sep 2005
    Posts
    233

    Re: Form Transparency. Help!

    I went to the tutorial, and i copied and pasted the code and it didnt work. I am fairly new to Visual Basic, so can you please help explain how I do it?

  6. #6
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Form Transparency. Help!

    Are you using Windows XP?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  7. #7
    Join Date
    Sep 2005
    Posts
    233

    Re: Form Transparency. Help!

    Yes

  8. #8
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Form Transparency. Help!

    Look at this code:

    It uses Alpha-Blending. Just move the slider!
    Attached Files Attached Files
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  9. #9
    Join Date
    Sep 2005
    Posts
    233

    Re: Form Transparency. Help!

    Thanks, but that isn't wut im looking for. I want to make unused parts of the form transparent.

  10. #10
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Form Transparency. Help!

    Maybe this then?:
    Attached Files Attached Files
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  11. #11
    Join Date
    Sep 2005
    Posts
    233

    Re: Form Transparency. Help!

    On the right track, but i need the form to be transparent. I have rounded corners on my app, and i want all the area not being used to be invisible.

  12. #12
    Join Date
    Oct 2005
    Location
    England
    Posts
    803

    Re: Form Transparency. Help!

    Try this one. Circular form

    Edit uploaded a better one using GDI to draw the circle.

    @Dan hope i've got it right with no memory leaks this time .
    @Shuja, used your great form move code.
    Attached Files Attached Files
    Last edited by Rich2189; July 24th, 2006 at 03:36 AM.
    Rich

    Visual Studio 2010 Professional | Windows 7 (x64)
    Ubuntu

  13. #13
    Join Date
    Sep 2005
    Posts
    233

    Re: Form Transparency. Help!

    That just makes a circle. Lets say I have a transparent picture of a trapezoid. How can I make the form diappear except for the part with the trapizoid on it?

  14. #14
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Form Transparency. Help!

    You mean showing the desktop?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  15. #15
    Join Date
    Sep 2005
    Posts
    233

    Re: Form Transparency. Help!

    yes

Page 1 of 3 123 LastLast

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

Featured