SetScrollPos:滚动条移动,但控件内容不更新
[DllImport("user32.dll")]
public static extern int SetScrollPos(IntPtr hWnd, int nBar, int nPos, bool bRedraw);
[DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
public static extern int GetScrollPos(int hWnd, int nBar);
所以这些是我用来移动滚动位置的外部程序,我在做什么,是我获取当前位置,并添加或减去确切数量的像素,并且我的表单上的滚动条完美地按照我想要的方式移动,但是控件中的内容保持静止。这里有什么问题呢?
[DllImport("user32.dll")]
public static extern int SetScrollPos(IntPtr hWnd, int nBar, int nPos, bool bRedraw);
[DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
public static extern int GetScrollPos(int hWnd, int nBar);
So those are the externs im using to move the scroll position, what im doing, is i get the current position, and add or substract an exact amount of pixels, and the scroll bar on my form moves perfectly how i want it, but the content in the control stays stationary. What is the problem here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了正确的 API 调用! :)
之前我只是使用 SetScrollPos,但这与 PostMessageA 结合起来效果很好
I found the correct API call! :)
before i was just using SetScrollPos, but this combined with PostMessageA works perfectly