Winform 内的框架?
我不确定它在 WinForms 领域被称为什么,但在 Web 开发术语中,我正在寻找一个可以添加到 winform 的框架类型元素。
我想要一个固定在顶部、底部、左侧、右侧的面板,但是如果将面板的表单大小调整为比面板中的元素更小,滚动条将出现在面板周围,允许用户查看面板的内容无需扩展表格。
我希望这是有道理的,并且这样的事情存在。
谢谢!
I'm not sure what it's called in the land of WinForms, but in web development terms, I'm looking for a frame type element that can be added to a winform.
I want a panel that is anchored top,bottom,left,right but if the form the panel is resized to a smaller size than the elements in the panel, scroll bars will appear around the panel allowing the user to see the contents of the panel without expanding the form.
I hope that makes sense, and that such a thing exists.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
是的,一个面板控件。将 AutoScrollMinSize 设置为滚动条出现之前所需的最小尺寸。将自动滚动设置为 True。如果需要的话设置MinimumSize,但不应该这样。
面板内的控件需要自行自动布局,以便当面板变小时它们会根据需要移动。使用它们的 Dock 或 Anchor 属性。如果布局变得复杂,则切换到 TableLayoutPanel 或 FlowLayoutPanel 控件。
Yes, a Panel control. Set AutoScrollMinSize to the minimum size you want before scrollbars appear. Set AutoScroll to True. Set MinimumSize if necessary, it shouldn't be.
The controls inside the panel need to auto layout by themselves so they'll move as necessary when the panel gets smaller. Use their Dock or Anchor properties. If the layout gets complicated then switch to a TableLayoutPanel or FlowLayoutPanel control.
面板怎么样?系统.Windows.窗体.面板
What about a panel? System.Windows.Forms.Panel
您正在寻找“面板”控件。只需设置“Dock”属性即可进行对接。
You are looking for a "Panel" control. Just set the "Dock" property to get docking going..
您将一个面板添加到表单并设置
Panel.Dock = Fill
。当您调整表单大小时,您的面板将自动调整大小。设置Panel.AutoScroll = True
然后,将控件添加到面板中。相应地设置控件的 Dock 属性。现在,当您调整表单大小时,如果控件被覆盖,则会出现滚动条。
You add a Panel to your form and set
Panel.Dock = Fill
. Your Panel will auto-resize when you resize the form.Set
Panel.AutoScroll = True
Then, you add controls to your Panel. Set the controls' Dock property accordingly. Now, when you resize the form, scrollbars will appear if controls are covered up.
标准 Windows 控件中有几个不同的面板可以执行您想要的操作...只需在编辑 Windows 窗体时查看工具箱中的“容器”下
您希望它包含什么?网页,还是只是 Windows 窗体控件?
There are a couple of different panels in the standard windows controls that do what you want... just look in the toolbox when editing a windows form, under 'container'
What do you want it to contain? A web page, or just windows form controls?