Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 C# 的 Windows 窗体中,我创建了 aUserControl并将一些控件放入其中,例如Tab Control和一些Grid Controls。它们实现了UserControl从边界到边界,但是当我动态加载UserControl到 a时,它本身不会延伸到.DockPanelUserControlDockPanel
UserControl
Tab Control
Grid Control
DockPanel
UserControl在设计屏幕属性上没有锚或停靠编辑器,我做了这样的事情:
private void MyUserControl1_Load(object sender, EventArgs e) { this.Dock = DockStyle.Fill; }