开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜