none
[ask]c# form handle windows aplication RRS feed

  • Pertanyaan

  • whether it is possible to control many forms in one form, eg using a windows form library in Windows Application,

    for example on the form to the left, as the menu and then on the right side is the content, such as Web Application
    thank your help

    • Diedit oleh prabowo Minggu, 07 November 2010 22.55 translate
    Minggu, 07 November 2010 22.37

Jawaban

  • I don't know if you already found a solution for your problem. But AFAIK, the best way to achieve such layout is by making your child forms as controls. So, instead of having menuForm, pageForm, mainForm... you can make it this way: mainForm, menuControl, pageControl...

    OR...

    IF it must be all in forms, you can move the controls inside a child form and place them into the container form... you can utilise the Control.AddRange method to achieve this, i.e.: mainForm.Controls.AddRange(menuForm.Controls)

    HOWEVER... I'm not sure if all controls can be moved using the AddRange method... especially the ones that are not serializable (i.e.: checkedlistbox, the items are not seriazible)... cmiiw


    • Disarankan sebagai Jawaban oleh tear_rex Senin, 27 Juni 2011 10.14
    • Saran Jawaban dibatalkan oleh tear_rex Senin, 27 Juni 2011 10.17
    • Ditandai sebagai Jawaban oleh Agnes SannieModerator Rabu, 29 Juni 2011 03.42
    Senin, 27 Juni 2011 10.13

Semua Balasan

  • it is possible to control a form to another form like multiple dialog this is hard way thought... but if u want a form to control multiple form..why dont u use MDI child form...
    Sabtu, 25 Desember 2010 08.27
  • I don't know if you already found a solution for your problem. But AFAIK, the best way to achieve such layout is by making your child forms as controls. So, instead of having menuForm, pageForm, mainForm... you can make it this way: mainForm, menuControl, pageControl...

    OR...

    IF it must be all in forms, you can move the controls inside a child form and place them into the container form... you can utilise the Control.AddRange method to achieve this, i.e.: mainForm.Controls.AddRange(menuForm.Controls)

    HOWEVER... I'm not sure if all controls can be moved using the AddRange method... especially the ones that are not serializable (i.e.: checkedlistbox, the items are not seriazible)... cmiiw


    • Disarankan sebagai Jawaban oleh tear_rex Senin, 27 Juni 2011 10.14
    • Saran Jawaban dibatalkan oleh tear_rex Senin, 27 Juni 2011 10.17
    • Ditandai sebagai Jawaban oleh Agnes SannieModerator Rabu, 29 Juni 2011 03.42
    Senin, 27 Juni 2011 10.13