Trouble Adding PropertyGrid to TabPages

  • Thread starter Thread starter Terry
  • Start date Start date
T

Terry

I have a very basic program, but for some reason I can't get it to behave
properly.

What I want is a basic form with a TabControl that fills the entire form.
The tab control should have 4 tabs with a single PropertyGrid control on
each tab that fills it's parent's tab page's client area.

Here's what I did.

1. Create a new project.
2. Add a TabControl to it, set its docking property to "Fill"
3. Add four tabs
4. Add a PropertyGrid to each tab and set the ProperyGrid's docking
property to "Fill".

In the designer, it displays properly when you switch tabs, but when you
actually run the program, only the very last PropertyGrid control that was
added displays properly.

It appears that all but the very last PropertyGrid control is sizing to the
area of the Form instead of its container.

Am I missing something? It does not do this with other controls I have
tried, just the PropertyGrid.

Terry
 
Yes, the toolbar and help area of the PropertyGrid controls are not visible
on those tabs that it isn't sizing properly.
I found that if I go to any tab and bring that PG control to the front, that
PG will display properly and the others will not.
 
Terry,
Which version of the framework?

With VS 2003 (.NET 1.1) it seems to size correctly, it just seems to only
want one to show the Help & Toolbar, based on the designer, I can manually
set the options and they stick.

I'll have to try with VB.NET.

Hope this helps
Jay
 
Yes, I am using VS .NET 2003 and .NET framework 1.1.

When you say "size correctly" do you mean that you can see the toolbar and
the help area in all of the tabs at runtime? The PG controls are all
resizing properly, but on all but one of the tabs, the toolbar and the help
area are missing. Just a white client area.

At this point, I do not have an object assigned to the "SelectedObject"
property. It's just the main form, the tab control, four tabs and four
PropertyGrid controls.

I've made the project available here
(http://www.sciencedrive.com/ServerInfo/CSTEST/TestPropGrid.zip ) if you'd
like to take a look at it. It has the project and my compiled Debug binary.

Thanks,
Terry
 
Terry,
When you say "size correctly" do you mean that you can see the toolbar and
the help area in all of the tabs at runtime? The PG controls are all
resizing properly,
Yes, the property grid remains docked correctly its size changes with the
size of the tab control.
but on all but one of the tabs, the toolbar and the help
area are missing. Just a white client area.
This is what I am seeing also, the 'first' grid displays the toolbar & help.
The other grids do not. I have not decided what constitutes the 'first'
grid, I did something yesterday and the 'first' grid became grid4.

I am going to try this in VB.NET to see if its something with the forms
designer. If you look at the generated code in the form, the others all have
the options explicitly turned off. If I add code after the
initializecomponent in the constructor to turn the options back on, all the
grids display the toolbar & help as expected. This leads me to believe the
forms designer, the property grid, or one of its attributes is doing
something at design time, as to have the options turned off in the generated
code.

Hope this helps
Jay
 
Thanks for looking at this. I was getting quite frustrated. :-)

I'll take a look at it and add some code to reset the options. I can't
believe I didn't notice that the generated code had those options turned
off! I was focusing on the TabPage settings and wasn't paying enough
attention to the PG control settings.

Terry
 
Back
Top