Hi all
-
I have a windows form of some size say (519, 118) now i have three pannels there somewhere in the center of the form.. now at run time i want to make some pannel invisible so how can i resize the form so that it form looks good ..means the space that was dedicated for pannel 1 is removed at run time :) Thank you ver much
vikas da
-
I have a windows form of some size say (519, 118) now i have three pannels there somewhere in the center of the form.. now at run time i want to make some pannel invisible so how can i resize the form so that it form looks good ..means the space that was dedicated for pannel 1 is removed at run time :) Thank you ver much
vikas da
your panel are in horizontal layout or verticle, what ever be change the logic accordingly set two properties Location and size First location Point (0,0) size(form.width,form.height/2) second location Point (0,form.height/2) size(form.width,form.height/2) That's it. (According to my perception) Be happy
Syed Shahid Hussain
-
I have a windows form of some size say (519, 118) now i have three pannels there somewhere in the center of the form.. now at run time i want to make some pannel invisible so how can i resize the form so that it form looks good ..means the space that was dedicated for pannel 1 is removed at run time :) Thank you ver much
vikas da
panel3.Visible = false; this.Size = new Size(this.Height - panel3.Height , this.Width); i am assuming all three panel are in vertically arranged and panel 3 is the last panel. or to make the load of the form as per available controls you can write the resize event of the form.
-
your panel are in horizontal layout or verticle, what ever be change the logic accordingly set two properties Location and size First location Point (0,0) size(form.width,form.height/2) second location Point (0,form.height/2) size(form.width,form.height/2) That's it. (According to my perception) Be happy
Syed Shahid Hussain
first of all sorry i was away from my system... it is not just a pannel on the form i am having grid and some button also... the pannels are just below the grid and above to buttons ... i was trying to dock the pannel but no luck coz it is neither top nor bottom or verticle .. thank you very much for ur help ... i am sorry i didnt clear all these points earlier ...
vikas da
-
panel3.Visible = false; this.Size = new Size(this.Height - panel3.Height , this.Width); i am assuming all three panel are in vertically arranged and panel 3 is the last panel. or to make the load of the form as per available controls you can write the resize event of the form.
-
I have a windows form of some size say (519, 118) now i have three pannels there somewhere in the center of the form.. now at run time i want to make some pannel invisible so how can i resize the form so that it form looks good ..means the space that was dedicated for pannel 1 is removed at run time :) Thank you ver much
vikas da
Hi, Instead of hiding and resizing the other panel use INHERITED FORM. This approach is better because it uses OOP when designing Windows forms. This concept is similar with MASTER PAGE of ASP.NET. Regards,
-
Hi, Instead of hiding and resizing the other panel use INHERITED FORM. This approach is better because it uses OOP when designing Windows forms. This concept is similar with MASTER PAGE of ASP.NET. Regards,
-
can you please explain me bit more... from where i should inherit and what functionality(property) should be there so the resizing part can be done easily ...
vikas da
.......................................................................
. .
. .
. .
. .
. .
. .
. .
. |--------------------------| .
. | pannel1 | .
. |--------------------------| .
. |--------------------------| .
. | pannel2 | .
. |--------------------------| .
. | pannel3 | .
. |--------------------------| .
. .
. .
. .
. .
.......................................................................so in above if i am saying panel1.hide so panel2 and panel3 should be on the place of panel1 and panel2 respectively i want to solve this one .. please help me ...
vikas da
-
.......................................................................
. .
. .
. .
. .
. .
. .
. .
. |--------------------------| .
. | pannel1 | .
. |--------------------------| .
. |--------------------------| .
. | pannel2 | .
. |--------------------------| .
. | pannel3 | .
. |--------------------------| .
. .
. .
. .
. .
.......................................................................so in above if i am saying panel1.hide so panel2 and panel3 should be on the place of panel1 and panel2 respectively i want to solve this one .. please help me ...
vikas da
Hi, What is the reason why you want to place those panels in one form and not creating 3 different forms? Is it you want to reuse the method, function and properties of form you've created and you don't want to repeat this codes in other form plus they have the same look and feel with some slight differences in Pane1, Panel 2 and Panel3. If your answer is YES you should go to inherited form. NOTE: Methods and Properties of Parent Form are visible to inherited Form (Only Public and Protected access modifiers). Parent Form
.......................................................................
. .
. .
. |--------------------------| .
. | Static Design | .
. |--------------------------|
. .
. .
. .
. |--------------------------| .
. | Area for | .
. | Other Panel | .
. |--------------------------| .. .
. .
. .
. .
.......................................................................Inherited Form Locked Static Design means you can only edited this on Parent Form.
.......................................................................
. .
. .
. |--------------------------| .
. | Locked - Static Design | .
. |--------------------------|
. .
. .
. -
.......................................................................
. .
. .
. .
. .
. .
. .
. .
. |--------------------------| .
. | pannel1 | .
. |--------------------------| .
. |--------------------------| .
. | pannel2 | .
. |--------------------------| .
. | pannel3 | .
. |--------------------------| .
. .
. .
. .
. .
.......................................................................so in above if i am saying panel1.hide so panel2 and panel3 should be on the place of panel1 and panel2 respectively i want to solve this one .. please help me ...
vikas da
No need for resizing, treat inherited forms as a new form with extra codes and design.