T
tom
BTW, don't press TAB to format your post and then hit
enter...like I did.
Like I said, I would like to replace a ListView's scroll
bars with buttons for easier use with a touch screen.
private static Int32 GWL_STYLE = (-16);
private static Int32 WS_VSCROLL = 0x00200000;
private static Int32 WS_HSCROLL = 0x00100000;
[DllImport("coredll")]
extern static IntPtr GetCapture();
[DllImport("coredll", CharSet=CharSet.Auto)]
internal static extern int SetWindowLong(IntPtr hWnd,
Int32 flag, int dwNewLong);
[DllImport("coredll", CharSet=CharSet.Auto)]
static internal extern Int32 GetWindowLong(IntPtr hWnd,
Int32 flag);
public static void removeListViewScrollBars
(System.Windows.Forms.ListView lV)
{
lV.Capture = true;
IntPtr iP = GetCapture();
Int32 GWret = GetWindowLong(iP,GWL_STYLE);
SetWindowLong(iP, GWL_STYLE, GWret & (~WS_VSCROLL));
lV.Capture = false;
}
I get 'real' return values from GetCapture and
GetWindowLong but...the scroll bar does not disappear.
I am calling after clearing, configuring and adding items
to the ListView, while it is disabled and invisible as
well as between BeginUpdate()/EndUpdate() calls.
enter...like I did.
Like I said, I would like to replace a ListView's scroll
bars with buttons for easier use with a touch screen.
private static Int32 GWL_STYLE = (-16);
private static Int32 WS_VSCROLL = 0x00200000;
private static Int32 WS_HSCROLL = 0x00100000;
[DllImport("coredll")]
extern static IntPtr GetCapture();
[DllImport("coredll", CharSet=CharSet.Auto)]
internal static extern int SetWindowLong(IntPtr hWnd,
Int32 flag, int dwNewLong);
[DllImport("coredll", CharSet=CharSet.Auto)]
static internal extern Int32 GetWindowLong(IntPtr hWnd,
Int32 flag);
public static void removeListViewScrollBars
(System.Windows.Forms.ListView lV)
{
lV.Capture = true;
IntPtr iP = GetCapture();
Int32 GWret = GetWindowLong(iP,GWL_STYLE);
SetWindowLong(iP, GWL_STYLE, GWret & (~WS_VSCROLL));
lV.Capture = false;
}
I get 'real' return values from GetCapture and
GetWindowLong but...the scroll bar does not disappear.
I am calling after clearing, configuring and adding items
to the ListView, while it is disabled and invisible as
well as between BeginUpdate()/EndUpdate() calls.