emeraldtea
Programmer
I have a Form, in the form a Panel and in the Panel a listbox.
When I do this in a single file(all form, panel and listbox located in the same file). And I set:
this.panel.Anchor = AnchorStyles.Left | AnchorStyles.Right |..Top |..Bottom;
this.listbox.Anchor = AnchorSytles.Left |..Right |..Top |..Bottom;
When I expand the form, the panel and listbox both expand accordingly.
But this is the simplest form only for practising in VS.
In my application, I have a Main in the form and in the form class, I add a panel object of another class(the listbox is in the panel).
In the form I have the Anchor statements as:
this.panel.Anchor = AnchorStyles.Left | AnchorStyles.Right |..Top |..Bottom;
this.panel.listbox.Anchor = AnchorSytles.Left |..Right |..Top |..Bottom; (I use this.panel.listbox here as listbox is in panel).
When the form is expanded, the panel expands but not the listbox.
Why is it?
I try another way: set the Anchor of listbox in the panel class where it is locasted instead of in the form class. It doesn't work either.
It should be.
Any comments?
When I do this in a single file(all form, panel and listbox located in the same file). And I set:
this.panel.Anchor = AnchorStyles.Left | AnchorStyles.Right |..Top |..Bottom;
this.listbox.Anchor = AnchorSytles.Left |..Right |..Top |..Bottom;
When I expand the form, the panel and listbox both expand accordingly.
But this is the simplest form only for practising in VS.
In my application, I have a Main in the form and in the form class, I add a panel object of another class(the listbox is in the panel).
In the form I have the Anchor statements as:
this.panel.Anchor = AnchorStyles.Left | AnchorStyles.Right |..Top |..Bottom;
this.panel.listbox.Anchor = AnchorSytles.Left |..Right |..Top |..Bottom; (I use this.panel.listbox here as listbox is in panel).
When the form is expanded, the panel expands but not the listbox.
Why is it?
I try another way: set the Anchor of listbox in the panel class where it is locasted instead of in the form class. It doesn't work either.
It should be.
Any comments?