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.
>> Anyone know of managed code or P/invoke to do this?
>>
[quoted text clipped - 3 lines]
> that one can be simply resized. Which one? Listview? Edit?
> Listbox/Combobox?
Daniel Moth - 23 Dec 2005 23:14 GMT
> 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
--
http://www.danielmoth.com/Blog/
> Sorry for not being clear on this. I am using VScrollbar class.
>
[quoted text clipped - 19 lines]
>> that one can be simply resized. Which one? Listview? Edit?
>> Listbox/Combobox?
Simon Hart - 24 Dec 2005 09:28 GMT
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.
>> knowing whether I am running > QVGA device. Because of this I cannot hard
> See the Screen.PrimaryScreen.Bounds.Width... For dpi look at the
[quoted text clipped - 28 lines]
>>> since that one can be simply resized. Which one? Listview? Edit?
>>> Listbox/Combobox?
Graham McKechnie - 24 Dec 2005 01:43 GMT
Simon,
What if you pass in the UserControl's form - you could use
if ( ((Form)owner).AutoScaleDimensions.Width == 192f)
Graham
> Sorry for not being clear on this. I am using VScrollbar class.
>
[quoted text clipped - 19 lines]
>> that one can be simply resized. Which one? Listview? Edit?
>> Listbox/Combobox?
Simon Hart - 24 Dec 2005 09:34 GMT
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.
> Simon,
>
[quoted text clipped - 26 lines]
>>> since that one can be simply resized. Which one? Listview? Edit?
>>> Listbox/Combobox?
Alex Yakhnin [MVP] - 27 Dec 2005 00:22 GMT
You can P/Inovke the GetSystemMetrics:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/html/ce
refGetSystemMetrics.asp
--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com | www.opennetcf.org
> Graham,
>
[quoted text clipped - 32 lines]
>>>> since that one can be simply resized. Which one? Listview? Edit?
>>>> Listbox/Combobox?
Alex Yakhnin [MVP] - 27 Dec 2005 14:51 GMT
Didn't realize that SDF already includes that in the
OpenNETCF.Windows.Forms.SystemInformationEx
--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com | www.opennetcf.org
> You can P/Inovke the GetSystemMetrics:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/html/ce
refGetSystemMetrics.asp
[quoted text clipped - 39 lines]
> >>>> since that one can be simply resized. Which one? Listview? Edit?
> >>>> Listbox/Combobox?
Simon Hart - 30 Dec 2005 10:24 GMT
Cool, nor did I, thanks Alex.
Cheers
Simon.
> Didn't realize that SDF already includes that in the
> OpenNETCF.Windows.Forms.SystemInformationEx
[quoted text clipped - 49 lines]
>> >>>> since that one can be simply resized. Which one? Listview? Edit?
>> >>>> Listbox/Combobox?