【问题标题】:How to get the position of the default vertical scroll bar in winforms textbox如何在winforms文本框中获取默认垂直滚动条的位置
【发布时间】:2021-11-24 17:14:55
【问题描述】:

我需要在 winforms 文本框中获取默认垂直滚动条的位置。 到目前为止,我只设法找到了一种方法来获取自定义滚动条的位置,而不是从 VS 设计器创建的默认滚动条的位置

【问题讨论】:

  • 我认为post 应该可以满足您的需求。

标签: c# winforms user-interface textbox


【解决方案1】:
using System.Runtime.InteropServices;

[DllImport("user32.dll", CharSet = CharSet.Auto)]

static extern int GetScrollPos(IntPtr hWnd, int nBar);

【讨论】:

  • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-03-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-06-04
  • 1970-01-01
相关资源
最近更新 更多