in my current Project on WinForms with .net3.5 I imported some User32.dll functions for scrolling programmatically. I extended the TableLayoutPanel – which is ought to be scrolled.
Everything worked fine after a bit of work, but now I found out that the function
GetScrollInfo(this.Handle, SB_VERT, ref _si);
always returns false when Visual Styles on Windows XP are deactivated. If Visual Styles are activated (everything else than “Classic” is ok), the above mentioned function returns true and the correct values.
How to avoid this, or how to get the correct ScrollValues without activating Visual Styles?
PS: _si is a Struct called SCROLLINFO described in the MSDN (I am not allowed to Link to more than one Page sorry) and GetScrollInfo is described here. this.Handle is the Handle of the base TableLayoutPanel.
After a little playing around with the SCROLLINFO struct I found it out on my own.
For everyone having the same problem, I had to set the cbSize of the SCROLLINFO struct to sizeOf(SCROLLINFO).
Something like
did the job for me.
Thanks to everyone thinking about my problem!