Change content in a windows form

前端 未结 2 1766
北海茫月
北海茫月 2021-01-02 04:27

I\'m making an application in C# using windows forms, I want to completely swap out all the content in a windows form and replace it with something else. Is there any conven

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-02 05:16

    This works for me: Adding all the controls like:

    form.Controls.AddRange(Pages.ToArray());
    

    Then activating the needed one with

    form.Controls[i].BringToFront();
    

提交回复
热议问题