How to expand the form using visual c#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to develop the form which allow expanable similar to the window
address book application. Which enable you to enter the keyword and press the
search button then the main form expand including the dataset.COuld any one
show me how to do this.
Thank you
 
You can change the form size at runtime by using the Form.Size property. The
dataset can be made to expand by using the appropriate anchors and some
panels.
 
Hi Popoxinhxan (great name by the way -sounds Greek or Peruvian perhaps?)

resizing the form at runtime is essentially easy, you would (as said) set
the Form.Size propery at runtime to the size of the item you want.
e.g. // I am resizing an existing form in it's loading event ...
System.Drawing.Size formsize = this.Size;
formsize.Width *= 2; //double forms width
this.Size = formsize; //set new formsize

I have a feeling though that what you are looking for is a form with a
datagrid and once the datagrid is set to a dataset, you want the datagrid
and form to expand to accomodate visually all the dataset data -am I right?
If so this is a lot more complicated. Let me know.

Br,

Mark.
 
Mark Broadbent said:
Hi Popoxinhxan (great name by the way -sounds Greek or Peruvian perhaps?)

resizing the form at runtime is essentially easy, you would (as said) set
the Form.Size propery at runtime to the size of the item you want.
e.g. // I am resizing an existing form in it's loading event ...
System.Drawing.Size formsize = this.Size;
formsize.Width *= 2; //double forms width
this.Size = formsize; //set new formsize

I have a feeling though that what you are looking for is a form with a
datagrid and once the datagrid is set to a dataset, you want the datagrid
and form to expand to accomodate visually all the dataset data -am I right?
If so this is a lot more complicated. Let me know.

Yes that's what i am looking for, please guide me how to do so.
Thank you.
 
Back
Top