Teal M Top Microsuede Sneaker 11 High US Women's Gracie BEARPAW zfqxwRXt Teal M Top Microsuede Sneaker 11 High US Women's Gracie BEARPAW zfqxwRXt Teal M Top Microsuede Sneaker 11 High US Women's Gracie BEARPAW zfqxwRXt Teal M Top Microsuede Sneaker 11 High US Women's Gracie BEARPAW zfqxwRXt
Results 1 to 5 of 5

Teal M Top Microsuede Sneaker 11 High US Women's Gracie BEARPAW zfqxwRXt

  1. Thread Starter
    Hyperactive Member
    Join Date
    Jul 2008
    Posts
    Gracie Microsuede Top 11 M High Sneaker US Teal Women's BEARPAW 268

    [RESOLVED] Semi-transparent form with opaque controls

    Hi there,

    I have a 75% transparent form and I would like the controls and elements that I place on it to be 100% opaque. I've searched but didn't turn up any results.

    Any help is greatly appreciated.

    David

  2. #2
    Frenzied Member
    Join Date
    Aug 2007
    Location
    Australia
    11 Top US Teal M BEARPAW High Sneaker Microsuede Gracie Women's Posts
    1,934

    Re: Semi-transparent form with opaque controls

    I don't believe you can set the opacity of individual controls, only the form I think, is that what you meant?

  3. Thread Starter
    Hyperactive Member
    Join Date
    Jul 2008
    Posts
    268

    Re: Semi-transparent form with opaque controls

    Yeah, that's what I'm looking for.

    I've drawn the same conclusion, though I figured there must be an API or something that could assist me?

  4. BEARPAW Sneaker US Teal Women's 11 Microsuede High Gracie M Top PowerPoster
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,016

    Re: Semi-transparent form with opaque controls

    You can do this by using two forms, one on top of the other. The bottom form (which is your main form) is partly opaque. The top form uses the TransparencyKey property to make everything but the controls invisible. We had a thread on much the same subject about three weeks ago ( http://www.vbforums.com/showthread.php?t=586364) but since then I have discovered that forms have a method which makes it all rather easy: AddOwnedForm.

    Here's an example. Add two Forms to your project (BottomForm and TopForm), make BottomForm the startup form, and add whatever controls you like to TopForm.
    Code:
    Public Class BottomForm
    
        Private Sub BottomForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
            'These are properties you could also set in the Designer
            Me.Opacity = 0.6F
            Me.BackColor = Color.Black 'for example
    
            TopForm.FormBorderStyle = Windows.Forms.FormBorderStyle.None
            TopForm.BackColor = Color.Magenta 'Choose any colour that does not appear in your controls
            TopForm.TransparencyKey = TopForm.BackColor
            TopForm.ShowInTaskbar = False
    
            'You have to do this in code:
            Me.AddOwnedForm(TopForm)
            TopForm.Show()
    
        End Sub
    
        Private Sub AlignForms(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged, Me.Move, Me.Layout
            TopForm.Location = Me.PointToScreen(Point.Empty)
            TopForm.Size = Me.ClientSize
        End Sub
    
    End Class
    Appreciation appreciated.
    Cheers, BB
    Last edited by boops boops; Oct 30th, 2009 at 06:40 AM. Reason: correction to TopForm.Location in AlignForms

  5. #5

    Re: Semi-transparent form with opaque controls

    Perfect! Exactly what I was looking for.

    Thanks a ton

39 Ankle 5 Ladies Heels fereshte Red Pointed 5 Lace Toe Back Casual UK Suede Mid Women's Boots Fashion 6PWdqwraP Posting Permissions

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

Blackstone Black Black Boots Biker Men’s Im12 006PA


Featured


Click Here to Expand Forum to Full Width
Microsuede Teal BEARPAW US Women's High 11 Sneaker Top Gracie M


Unisex Core Cherry 1919 Red Martens Adult Dr Boots qUAHt5xw