Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

What's involved in using tabs on a WinForms dialog?

I use C# and need to add tabs to my dialog. What's involved?

Thanks.
SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of curiouswebster

ASKER

I'll let you know Monday :)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I created the TabControl, added a third Tab Page, but can not keep the DataGridView inside of it. When I run the app, the DataGridView is drawn much higher on the dialog than the start of the TabControl.

What do I need to do to associate the DataGridView with a particular Tab Page, other than dragging in ont it?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
nothing works. This DataGridView control has a mind of its own.  Anchor, Dock, even forcing the Location to a known value of the "containing" object does nothing.

I say "containing" since just because the Designer shows that the DataGridViews inside a TabPage or a GroupBox does not mean it will anchor to THAT control.

I am so puzzled. At runtime, this DataGridView is never anywhere near where it's supposed to be.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, when I move the Tab Control, the DataGridView and the GroupBox I placed it inside of all move in unison.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sec...
This id Design Time and Run Time
DesignTime.bmp
RunTime.bmp
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Upper left corner of the dialog with background fill color throughout rest of the dialog.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
After I dragged it back, it fails regardless of whether Dock is set to None or some other value.

The highlight properties are "AutoSize" for ColumnHeaderHeightSizeMode

The Location is Bolded, but the Locked value is False.

RowTemplate is bolded with a value of DataGridViewRow { Index =-1 }

Dragging a brand new DataGridView has these same values, and they all fail.
Thanks for all the help.