开发者

How to close the current form in a SplitContainer?

开发者 https://www.devze.com 2023-04-09 11:18 出处:网络
I have a us开发者_如何转开发er control in my SplitContainer\'s right panel. A form opens below the user control. Now if i click a button in the user control, that current form should close and a new f

I have a us开发者_如何转开发er control in my SplitContainer's right panel. A form opens below the user control. Now if i click a button in the user control, that current form should close and a new form should open. How to do this?


You can implement below logic in your app easily:

splitContainer.Panel2.Controls.Remove(myPanel);
splitContainer.Panel2.Controls.Add(myOtherPanel);

which will remove the existing panel from the container and place the other panel. You can extend the same logic to place forms, or separate controls on the container easily.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号