Are you ever going to make objects have a transparency option?-VBForums
Results 1 to 9 of 9

Thread: Are you ever going to make objects have a transparency option?

  1. #1

    Thread Starter
    Frenzied Member Icyculyr's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    1,933

    Are you ever going to make objects have a transparency option?

    Hey everyone, this is something I often want to use, but am unable to..

    I would really like seeing a transparency / opacity option in objects (such as picture boxes, perhaps buttons and labels as well)

    I think it would be a very nice feature?

    What does everyone else think?

    Cheers
    Share on Google+

  2. #2
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    59,687

    Re: Are you ever going to make objects have a transparency option?

    I could see a variation of this as being an improvement in the background property of groupboxes or pictureboxes. Simply setting the property to Transparent only makes it inherit the parent container color and not be an actual "transparency". If you have a form with a backgroud image and a label above it, the labels Background color property of Transparent will only color the label as Control color and not allow the image that the label covers show through.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (VBA, VB 6, VB.NET, C#)
    Senior Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista (New)Multiple .NET Framework Versions (New)Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007
    Share on Google+

  3. #3
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,595

    Re: Are you ever going to make objects have a transparency option?

    I assumed this kind of thing would be an option with the VS2008 controls what with Vista and its Aero Glass stuff coming out before VS2008....but unfortunately not
    Share on Google+

  4. #4
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,981

    Re: Are you ever going to make objects have a transparency option?

    I'm curious as to why you would even want a button to be transparent? That seems like a big usability issue and annoyance to me though I guess there could be some application for it.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes
    Share on Google+

  5. #5
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    59,687

    Re: Are you ever going to make objects have a transparency option?

    Labels, Picutreboxes, Panels and GroupBoxes are probably the most needed and feasible controls that would benefit from it.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (VBA, VB 6, VB.NET, C#)
    Senior Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista (New)Multiple .NET Framework Versions (New)Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007
    Share on Google+

  6. #6

    Thread Starter
    Frenzied Member Icyculyr's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    1,933

    Re: Are you ever going to make objects have a transparency option?

    Meh, I was just thinking of objects that could make use of transparency...
    some funky layout's I can imagine making:P

    I would like VB to add it so you can set transparency / opacity % like with a form... that way you can have 20% transparent picture boxes etc..

    If they added transparency it would make my day

    Cheers
    Share on Google+

  7. #7
    Special Guest - Microsoft
    Join Date
    Dec 2007
    Posts
    36

    Re: Are you ever going to make objects have a transparency option?

    Thanks - I've been passing this specific feedback on to the Windows Forms and Client teams.

    There's a trick you can use that will get you part of the way - setting alpha transparency on the background color. This works with Labels, Panels, and similar containers. It is not compatible with BackGroundImage settings or PictureBox -- you'd need to put the image behind the partially transparent panel on another control or on the form. Using this you can arrive at a glassy look.

    Please try this trick and let me know what you think. If you like it I could show you how to combine it with an extender property so it shows up off of controls (much like Tooltips).


    SetTransparency(Me.Panel1, 50)

    '..

    Public Sub SetTransparency(ByRef ctrl As Control, ByVal percentTransparent As Integer)

    Dim alpha As Decimal = percentTransparent / 100 * 255

    ctrl.BackColor = Color.FromArgb(alpha, ctrl.BackColor)

    End Sub
    Paul Yuknewicz
    Lead Program Manager
    Microsoft Visual Basic
    http://msdn.com/vbasic
    Share on Google+

  8. #8

    Thread Starter
    Frenzied Member Icyculyr's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    1,933

    Re: Are you ever going to make objects have a transparency option?

    Yes, that is cool, thanks...

    If you like it I could show you how to combine it with an extender property so it shows up off of controls (much like Tooltips).
    That would be good..


    Thanks alot.
    Share on Google+

  9. #9
    Special Guest - Microsoft
    Join Date
    Dec 2007
    Posts
    36

    Re: Are you ever going to make objects have a transparency option?

    Sorry it took me so long to pull this together!

    I'm attaching a sample project. The key parts are:
    -TransparencyHelper.vb -- this is a component class (like tooltip) that you can trag onto a form to extend other controls with a Transparency property. I've implemented IExtenderProvider and set various attributes to show you how that works. Note, you can change "CanExtend" method to allow this property to show up on more container types.
    -TestForm.vb - shows how to set properties at design-time and in code

    Per above, transparency isn't the most reliable technology (e.g. different video cards work better with it than others) but you can use it at your own risk and have fun with it.

    Enjoy.
    Attached Files Attached Files
    Paul Yuknewicz
    Lead Program Manager
    Microsoft Visual Basic
    http://msdn.com/vbasic
    Share on Google+

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.