PDA

Click to See Complete Forum and Search --> : ComboBox - Finger Friendly Possible?


magohn
Aug 3rd, 2009, 11:06 AM
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

petevick
Aug 4th, 2009, 12:27 AM
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

magohn
Aug 4th, 2009, 03:07 PM
...

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:

MyBox1.DroppedDown = Not MyBox1.DroppedDown

Unfortunately this is yet another unsupported ability in .NET as I get the following build error:

Error 1 'DroppedDown' is not a member of 'System.Windows.Forms.ComboBox'.

Any ideas to get around this appreciated...

petevick
Aug 5th, 2009, 01:33 AM
Hi,
you need to use sendmessage.

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

SendMessage(ComboBox1.Handle, CB_SHOWDROPDOWN, 1, 0)

magohn
Aug 5th, 2009, 11:53 AM
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 :)

petevick
Aug 5th, 2009, 12:14 PM
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.