3 Replies - 2044 Views - Last Post: 11 December 2013 - 09:27 PM Rate Topic: -----

#1 allanblackford   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 11-December 13

Custom Control Panel Sends Children to Back

Posted 11 December 2013 - 02:30 PM

I attempting to create a custom control panel that behaves similar to the properties and solution explorer panels in visual studio. I'd like to be able to use this control on different projects, so I've only added a panel with a 'vertical' button (found code from msdn for the button) to the panel.

In my test project I can drop the control onto my form, run it and it all behaves as I would expect. But, when I add a child control, such as a label or tabControl, to the my user control, aka slidingPanel, the child control is sent to the back.

In the form load method I can add label1.BringToFront() and the label is visible, but that's the only way.

Is This A Good Question/Topic? 0
  • +

Replies To: Custom Control Panel Sends Children to Back

#2 CharlieMay   User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1729
  • View blog
  • Posts: 5,708
  • Joined: 25-September 09

Re: Custom Control Panel Sends Children to Back

Posted 11 December 2013 - 02:34 PM

in your code how are you adding the child control? Are you adding it to the panel inside your control or the controls container itself?
Was This Post Helpful? 0
  • +
  • -

#3 andrewsw   User is offline

  • blow up my boots
  • member icon

Reputation: 6551
  • View blog
  • Posts: 26,559
  • Joined: 12-December 12

Re: Custom Control Panel Sends Children to Back

Posted 11 December 2013 - 02:53 PM

If you want something like the Properties Window then there is already a PropertyGrid Control (just in-case you weren't aware..).

There is also a DockPanelSuite which mimics Visual Studio.

This post has been edited by andrewsw: 11 December 2013 - 03:02 PM

Was This Post Helpful? 0
  • +
  • -

#4 allanblackford   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 11-December 13

Re: Custom Control Panel Sends Children to Back

Posted 11 December 2013 - 09:27 PM

View PostCharlieMay, on 11 December 2013 - 02:34 PM, said:

in your code how are you adding the child control? Are you adding it to the panel inside your control or the controls container itself?


In my example, the label and tabControl are being added in design view on a test form in the form design view, not in the user control design view. My goal was to have a user control I could use in multiple projects. But, obviously, if I can't see child controls I'm dropping onto my custom control it's pretty much useless. The screen shot attached shows my slidingPanel with vertical button, which is part of the user control. The outlined control that isn't visible is a tabControl that I dropped onto the user control. But as you can see it is being sent to the back. Pretty much making it useless in design view.

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1