且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在C#中将用户控件动态添加到面板中

更新时间:2023-11-05 08:09:28

您确定要替换它们吗?不只是将新的放在顶部吗?

如果在创建新文本框时指定相对于面板TLHC的位置,则必须为已添加的文本框抵消一定数量的最高帐户.

在添加"按钮上放置一个断点,然后逐步执行-您应该以这种方式找到它.
Are you sure it''s replacing them? Not just putting new ones over the top?

If when you create the new text boxes you specify the location relative to the TLHC of the panel, you will have to offset them by some amount top account for the ones you already added.

Put a breakpoint on your Add button, and single step through - you should find it that way.


我相信以下网址可以为您提供帮助

动态添加和删除用户控件 [
I believe the following URL can help you

Dynamically add and remove user controls[^]