Width of scrollbar under Pocket PC

  • Thread starter Thread starter Simon Hart
  • Start date Start date
Simon said:
Anyone know of managed code or P/invoke to do this?

Cheers
Simon.
I assume you are not talking about a standalone scroll bar control,
since that one can be simply resized. Which one? Listview? Edit?
Listbox/Combobox?
 
Sorry for not being clear on this. I am using VScrollbar class.

I need to know the system width of a standard scrollbar if one exists. This
is to support hires devices. I have written a UserControl class which
consumes the VScrollbar class and there is no way (to my knowledge) of
knowing whether I am running > QVGA device. Because of this I cannot hard
code with width.

Using ContainerControl.AutoScaleDimensions returns 0 when called within a
inherited UserControl class.

This needs to be supported from WM2003SE and onwards inc WM2005.

Cheers
Simon.
 
knowing whether I am running > QVGA device. Because of this I cannot hard
See the Screen.PrimaryScreen.Bounds.Width... For dpi look at the
Graphics.DpiX property...

Cheers
Daniel
 
Simon,

What if you pass in the UserControl's form - you could use
if ( ((Form)owner).AutoScaleDimensions.Width == 192f)

Graham
 
I can't use GDI because this is a OwnerDrawn class which is inherited by
another UserControl which actually does the GDI. This owner drawn classes
takes care of the items, events and scrollbar etc.

However, I could use the Screen class to figure out if running > 96 dpi.
This is how I used to handle DPI aware under CF1.

Cheers
Simon.
 
Graham,

Not quite as easy to do as this particular class is an OwnerDrawn form which
gets inherited from. Thanks for the suggestion. See my above post.
Cheers
Simon.
 
Didn't realize that SDF already includes that in the
OpenNETCF.Windows.Forms.SystemInformationEx
 
Back
Top