如果这是 WPF,则此处存在一个示例,该示例位于解决方案的基础上挂钩到ListView.LayoutUpdated.
如果这是 WinForms,您可以使用 pinvoke 和GetWindowLong ...
static public class WndInfo
{
[DllImport("user32.dll", SetLastError = true)]
static extern int GetWindowLong(IntPtr hWnd, int nIndex);
...
public static bool IsWindowTopMost(IntPtr Handle)
{
return (GetWindowLong(Handle, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0;
}
...
}
Run Code Online (Sandbox Code Playgroud)
VB 代码用于GetWindowLong检查 ScrollBar 是否存在,您可以将其移植到 C#。
| 归档时间: |
|
| 查看次数: |
5192 次 |
| 最近记录: |