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.
如何获得水平滚动条滚动的距离(以像素为单位)?我试过查看其他答案,但只解决了垂直滚动条,我不知道如何将其转换为水平滚动条。
通常splitcontainer用于将一个区域一分为二。控件不会添加到SplitContainer自身。我假设您已添加控件SplitContainer.Panel1并SplitContainer.Panel2读取这些值,请尝试以下操作。
splitcontainer
SplitContainer
SplitContainer.Panel1
SplitContainer.Panel2
int p1Hscroll = splitContainer.Panel1.HorizontalScroll.Value; int p2Hscroll = splitContainer.Panel2.HorizontalScroll.Value;