ComboBox - Finger Friendly Possible?
Hello All,
I have created an application that uses drop-down combo boxes to populate a database on a 6.1x device. However, I despise the need to pull out the stylus in order to click on the tiny down-arrow on the combobox that then shows you the combobox contents. Is there an easy way to make these boxes "finger-friendly"? A simple method for resizing the drop-down "arrow" / list choices, for example.
Thanks all, Magohn
Re: ComboBox - Finger Friendly Possible?
you can change the width of the scroll bar, and the height of the button by looking at the registry entries
HKEY_LOCAL_MACHINE\System\Gwe\cyVScr
HKEY_LOCAL_MACHINE\System\Gwe\cxVScr
The first is the height of the button - try 20 and the second is the width of the scroll bar - try 20 again
However, this is a global change, and effects all of the sytem - so be warned.
Alternately, design your own button, and put that over the arrow, and on click, progamatically dropdown the combo
Re: ComboBox - Finger Friendly Possible?
Quote:
Originally Posted by
petevick
...
Alternately, design your own button, and put that over the arrow, and on click, progamatically dropdown the combo
I like this idea - thanks. I created a button and thought I would use the following to toggle the dropdown list:
Code:
MyBox1.DroppedDown = Not MyBox1.DroppedDown
Unfortunately this is yet another unsupported ability in .NET as I get the following build error:
Code:
Error 1 'DroppedDown' is not a member of 'System.Windows.Forms.ComboBox'.
Any ideas to get around this appreciated...
Re: ComboBox - Finger Friendly Possible?
Hi,
you need to use sendmessage.
Code:
Private Const CB_SHOWDROPDOWN As Integer = &H14F
Declare Function SendMessage Lib "coredll.dll" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As IntPtr
then on the button click do
Code:
SendMessage(ComboBox1.Handle, CB_SHOWDROPDOWN, 1, 0)
Re: ComboBox - Finger Friendly Possible?
Thanks so much - again :) - worked like a charm.
Is there a book or reference that lists pieces of code such as this? I can find numerous references to VB6 but very little on .NET ...
Thanks again, Magohn :)
Re: ComboBox - Finger Friendly Possible?
This forum usually has lots of hints.
What you can't achieve directly in .Net CF, there is usually a way round it - this being a prime example. SendMessage is very powerful.
Take a look at pinvoke.net - that is a treasure trove for API definitions and how to use them.