开发者

How to add all controls of another form to a form in Winforms?

开发者 https://www.devze.com 2022-12-08 02:58 出处:网络
I tried using: CoolForm.ActiveForm.Controls but the count returns 0. The main form that is shown is AppForm and has all the controls.

I tried using:

CoolForm.ActiveForm.Controls

but the count returns 0.

The main form that is shown is AppForm and has all the controls.

I want to add all the controls of CoolForm (wh开发者_高级运维ich has 1 form) to be added to the main form (AppForm)

Is this possible?


I found the answer, I had to instantiate CoolForm inside AppForm and then access its controls. But if there is a better way, let me know.

0

精彩评论

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