将控件添加到标签页上具有滚动条的位置
我有一个 TabPage,上面有许多不同的滑块控件(一些自定义范围滑块控制一些普通的 TrackBar 控件)。当用户勾选或取消勾选某些复选框时,它会删除所有控件并再次重新构建它们(根据需要 - 一定数量的范围滑块和 b 数量的轨迹栏)。
但我有一个问题,因为 TabPage 有一个垂直滚动条,它在用户滚动到的位置处将初始 x,y 位置设置为 0,0。因此,如果用户向下滚动,勾选一个框,所有控件都会位于比应有位置更低的位置。
有没有办法将初始位置指向实际标签页0,0?
或者有没有办法将控件(具有相同属性)更改为另一种控件类型,而不是删除和添加控件?
I have a TabPage with a number of different slider controls on it (some custom range slider controls some normal TrackBar controls). When the user ticks or de-ticks certain checkboxes it deletes all the controls and re-constructs them again (according to what is required - a amount of range sliders and b amount of Trackbars).
I have a problem though, because the TabPage has a vertical scrollbar, it takes the initial x,y location to be 0,0 at the point where the user has scrolled to. So if the user scrolls down, ticks a box all the controls get located at lower points than where they should be.
Is there a way to change the initial location points to the actual tab page 0,0?
Or is there a way to change a control (which has the same properties) to another control type instead of delete and add one?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了回答我自己的问题,我保存了当前控件的当前位置,并用它来重建新控件。
To answer my own question, I saved the current locations of the current controls and used that to reconstruct the new controls.