Re: [2.0] problems with setting Parent & displaying icons
You should be using an MDI interface, not embedding forms directly into the parent. I assume that you have a ToolStripContainer in the parent form and that's why you're doing that, but it's not necessary. You can add individual ToolStripPanels to the edges of the form that you want to be able to drag ToolStrips to, which doesn't cover the entire client area the way a ToolStripContainer does. The ToolStripPanel is not in the Toolbox by default so you need to add it manually.
Note that you need careful what order you add your controls when doing this. Once you have a ToolStripPanel in the designer with no strips in in it seems to be impossible to drag any existing controls into it. What you can do in that case is select the ToolStripPanel in the Properties window, add a new ToolStrip to it from the Toolbox to expand it, drag your existing ToolStrip into it and then delete the dummy.
Below is an image of a genuine MDI form I created using these steps. Here's the code I used to change the background colour of the client area in the Load event handler:
VB Code:
For Each cntrl As Control In Me.Controls
If TypeOf cntrl Is MdiClient Then
cntrl.BackColor = Color.Magenta
End If
Next cntrl
Obviously you'll want to choose a less offensive colour.
Re: [2.0] problems with setting Parent & displaying icons
thanks for the reply jmcilhinney, I probably should have explained a bit more about what I'm doing. The user needs to be able interact with the area behind the child forms - below is an example i posted in this thread last year when I was trying to do this in VB6:
well i managed to do it in VB6 - using a MDIChild that was always kept the same size as the MDIForm client area and using SetParent to place the child forms within that + plus a large dose of subclassing (i implemented other things that restricted the size / position of the child forms - which I'm not so bothered about this time) - anyway I was hoping it might be a bit simpler in .Net, or am I going to have to start flinging the APIs around?
and do you know why those icons are displaying incorrectly in the first post?
cheers
Last edited by bushmobile; Dec 21st, 2006 at 07:28 PM.