Results 1 to 6 of 6

Thread: ComboBox - Finger Friendly Possible?

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2009
    Posts
    47

    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

  2. #2
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2009
    Posts
    47

    Smile Re: ComboBox - Finger Friendly Possible?

    Quote Originally Posted by petevick View Post
    ...

    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...

  4. #4
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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)
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  5. #5

    Thread Starter
    Member
    Join Date
    Apr 2009
    Posts
    47

    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

  6. #6
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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.
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width