none
Visual Studio 2015 Panel transparency does not work

    Question

  • Goodday

    All Panels, Picture Boxes, Group Boxes etc. seem to be covering my Buttons and labels although the backcolor is set to transparent.

    A solution would be to set every Item below the Panel on top manually as:

    Button.BringToFront();

    Trouble is since the Panel will be dynamically created, I will never know what exactly is below the panel. Mind the buttons and labels below the Panel are also dynamically created so I don't see how I even have a reference to the objects that I don't know wether they are below the panel.

    I see only two ways of solving this problem:

    1) Making the Panel Transparent OR 2) Find a way to access all the objects hidden below it.

    I don't know if this is too much for just one question but I hope it will be fine.

    Regards
    • Moved by Greazer Thursday, February 04, 2016 6:11 PM More appropriate forum
    Sunday, January 31, 2016 5:56 PM

All replies

  • Hi AzulShiva,

    Could you please tell me what's the type of your project?

    Since Our forum is discussing about VS general question like how to set/configure Visual Studio and Visual Studio tools.

    If you could tell me your project type and your development language, I will help move your thread to corresponding forum for better support.

    Thanks for your understanding.

    Best Regards,

    Lake Xiao

    Friday, February 05, 2016 3:18 AM
    Moderator

  • 1) Making the Panel Transparent OR 2) Find a way to access all the objects hidden below it.


    Hi,

    you could loop over all controls and check wether its ClientRectangle intersects with the panel's ClientRectangle.

    Regards,

      Thorsten

    Friday, February 05, 2016 1:31 PM
  •  Mind the buttons and labels below the Panel are also dynamically created so I don't see how I even have a reference to the objects that I don't know wether they are below the panel.

    You will have put them somewhere to the Forms (or a parent Control's) Control Collection like this.Controls.Add(myNewButton);...

    So you always can [maybe recursively] iterate the Controls collection (if a Control has Children recursively call the method with that control as parameter)...

    Regards,

      Thorsten

    Friday, February 05, 2016 1:33 PM