A
Alain Dekker
Hi,
Got this code from Google, but it doesn't work:
//...
private const int WS_VSCROLL = 0x200000;
//...
//...
[DllImport("coredll.dll")]
public static extern int GetWindowLong(IntPtr hWnd, int Index);
//...
//...
private static bool IsScrollbarVisible(IntPtr hWnd)
{
// Determines whether the vertical scrollbar is visible for the specified
control
bool bVisible = false;
int nMessage = WS_VSCROLL;
int nStyle = GetWindowLong(hWnd, nMessage);
bVisible = ((nStyle & nMessage) != 0);
return bVisible;
}
//...
//...
bVisible = IsScrollbarVisible(lstAccounts.Handle);
//...
Problem is that bVisible is always false, regardless of whether the vertical
scrollbar is actually displayed or not. nStyle is always 0 above.
This was programmed in VS2005 using the CF .NET v2.0 for Windows CE.
Thanks,
Alain
Got this code from Google, but it doesn't work:
//...
private const int WS_VSCROLL = 0x200000;
//...
//...
[DllImport("coredll.dll")]
public static extern int GetWindowLong(IntPtr hWnd, int Index);
//...
//...
private static bool IsScrollbarVisible(IntPtr hWnd)
{
// Determines whether the vertical scrollbar is visible for the specified
control
bool bVisible = false;
int nMessage = WS_VSCROLL;
int nStyle = GetWindowLong(hWnd, nMessage);
bVisible = ((nStyle & nMessage) != 0);
return bVisible;
}
//...
//...
bVisible = IsScrollbarVisible(lstAccounts.Handle);
//...
Problem is that bVisible is always false, regardless of whether the vertical
scrollbar is actually displayed or not. nStyle is always 0 above.
This was programmed in VS2005 using the CF .NET v2.0 for Windows CE.
Thanks,
Alain