How to add the same control into multi panel in C#?

前端 未结 3 691
自闭症患者
自闭症患者 2021-01-18 14:49

I have a button called button1 and two panels called: panelA and panelB (visible is false by default) and the following code (WinForms):

panelA.Controls.Add(         


        
3条回答
  •  甜味超标
    2021-01-18 15:51

    The object button1 can have only one visual parent. Therefore you shouldn't add it to 2 different parents.

    So, you need to have 2 button objects.

提交回复
热议问题