c# - GetScrollInfo only works when visual styles are activated -


in current project on winforms .net3.5 imported user32.dll functions scrolling programmatically. extended tablelayoutpanel - ought scrolled.

everything worked fine after bit of work, found out function

getscrollinfo(this.handle, sb_vert, ref _si); 

always returns false when visual styles on windows xp deactivated. if visual styles activated (everything else "classic" ok), above mentioned function returns true , correct values.

how avoid this, or how correct scrollvalues without activating visual styles?

ps: _si struct called scrollinfo described in msdn (i not allowed link more 1 page sorry) , getscrollinfo described here. this.handle handle of base tablelayoutpanel.

after little playing around scrollinfo struct found out on own.

for having same problem, had set cbsize of scrollinfo struct sizeof(scrollinfo).

something like

    public scrollableexampleconstructor()     {         _si = new scrollinfo();         _si.fmask = (uint) scrollinfomask.sif_all;         _si.cbsize = (uint)system.runtime.interopservices.marshal.sizeof(_si);     } 

did job me.

thanks thinking problem!


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -