Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box Drop Down Arrow 5

Status
Not open for further replies.

gbcpastor

Programmer
Jun 12, 2010
77
US
Is there a way to increase the size of the drop down arrow in the combo box? I'm doing a touch screen app and need that box to be fat finger friendly.
 
You can increase the height of the arrow by increasing the height of the combo box, but that would look a bit weird. There's no native way of increasing the width.

You might be able to get the desired effect by experiment with Themes. I've never done that.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I don't think themes would work as this app is going to be on several different machines. Is there a way to hack the class?
 
I don't know about hacking the control, but you might be able to create a version that meets your requirements.

Off the top of my head, you could do something like this:

1. Create a new class based on a container.

2. Place a combo box in the container.

3. Place a button in the container. Set its Picture property to show a large down-pointing arrow.

4. Re-arrange and resize the combo and the button so that the button completely covers the combo's arrow, but does not obscure any other important elements.

5. In the Click event of the button, write some code to programmatically open the combo box. The code should first set focus to the combo, and then [tt]KEYBOARD "{ALT+DNARROW}"[/tt] to open it.

I think this might give you roughly what you are looking for, but I haven't tried it myself and it will probably need some tweaking.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks Mike; I did that but when you click on anything in the combobox, it moves to the top and covers the left side of the command button. Looks really ugly.

But, thanks for the suggestion.
 
First of all, I should mention that I never liked the combobox at all ;)
So, that said, I usually do something like Mike described in his post...

1. Create a new class based on a container
2. Place a TEXTBOX in the container
3. Place a button or image in the container
4. let the btn/img call a list and show it where the dropdownbox of the combo would be displayed.

as long as you don't have an activeX control or a grid right below the simulated combo everything will work. However, if there is one of those components involved, the list must be shown within its own form, otherwise it will be filled with graphical artifacts of the activeX (activeX is always displayed ON TOP) or the grid.

JM2C ;)

-Tom
 
You may clip the combobox with a container so it's button is not shown, but that would also mean the scrollbar of the dropdown list will not show.
Anyway, you have the same problem with the scrollbar and its buttons, they will also look smaller.

I know a POS system solving that size problem by only using OCX controls. That has its downsides, but in regard of resizing there are these details, which won't resize well, eg the dropdown button width. It also doesn't adjust when you set the FontSize higher.

Bye, Olaf.

Olaf Doschke Software Engineering
 
If all else fails, another option would be to do away with the combo box entirely, and use some other method of letting the user make the their choice.

If you have only a few items (say, three or four) to choose from, an option group might work. You can't increase the size of the buttons in an option group, but you can increase the size of the text. The point is that, unlike with a combo, the user doesn't have to click a button to make a choice with an option group; they can just as well click on the text.

If you have more than a few items, another poossibility is a list box. Again, the user only has to click on the text in order to make a selection from a list box, and you can make the text as large as you like.

Both these options will take up more space than a combo. But isn't that always going to be a problem with a touch screen.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Indeed, if we talk about touchscreen the interface of a list dropping down after you press a button is not much better, even if the button can be larger. It's obviously a fast fix if the interface can be finger friendlier, but touch interface ideally needs a redesign

In case of the POS system, I already talked about many options are behind the num pad, by using it as a hierarchical menu, when you press a num key on screen (or in some cash boxes on the real num pad) you drill down detail menu and further until you get to the details. That requires a bit more training of where to find what, but finger memory makes this easy for the experienced cashier. One advantage is the position of items for choice is always in this 12 key area.

It's still also the keys for entering prices, that are not covered by barcodes, but that has become a side feature, almost.

Anyway, no matter what's your case, the general idea behind this is an array of buttons also can very quickly lead you to pick a certain choice.

Bye, Olaf.

Olaf Doschke Software Engineering
 
I'm thinking my solution is going to be a group of objects.
1. A Textbox to hold the selection made
2. A ListBox controlled by Large Buttons for PGUP and PGDN
3. Three Command Buttons for the Controls PGUP, PGDN and OPEN LISTBOX

When they touch the "Opener Button" I'll made the list visible and allow a touch select. When they select, I'll assign the selection to the text box and set the visible property of the listbox and pgup, pgdn buttons to False.

I'm thinking this may be my only solution. I hate it but I think it will work. Just seems very patchy to me.

Thanks everyone for your input. And Tom, I too hate combobox's.

 
Code:
oform1=NEWOBJECT("form1")
oform1.Show()

DEFINE CLASS form1 AS form
   ADD OBJECT myCB as Combobox WITH FontSize=30,Height=50,Width=150
   ADD OBJECT myCM as CommandButton WITH Caption="Show List",Height=100
   PROCEDURE Init
      thisform.myCM.Top=thisform.myCB.Height
      thisform.myCM.Width=thisform.myCB.Width
      thisform.myCB.AddItem('One')
      thisform.myCB.AddItem('Two')
      thisform.myCB.AddItem('Three')
   PROCEDURE myCM.Click
      thisform.myCB.Setfocus()
      KEYBOARD '{Alt+DNARROW}'
ENDDEFINE
 
This was my first try. Great class define and it works if you are only going to drop the box one time. But it gets nasty looking if you use your command button more than once because the "Focus" bounces between the CB and the CM objects.

Thanks for posting newtofoxpro!
 
The more I think about this, the more I like the suggestion of an array of buttons. Assuming you have no more than, say, a dozen options, an array of buttons would be reasonably compact, while each button could still be large enough to be finger-friendly. Most importantly, the user can see all the options at a glance, and only has to touch in one place, compared to a minimum of two for a combo box (on the down arrow and the required option), or more if it involves scrolling.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I like the idea, newtofoxpro, as the activation button then is in the area you will click/touch next again. If it's that large and so little options you can go for buttons right away, but I would even adjust the concept to an area not necessarily looking as a button. It's an area somehow lost for other things, but forms shouldn't be crowded anyway.

One other simple idea is to let the whole CB act as its own drop down button:

Code:
oform1=NEWOBJECT("form1")
oform1.Show()
READ EVENTS
 
DEFINE CLASS form1 AS form
   ADD OBJECT myCB as Combobox WITH FontSize=30,Height=50,Width=150,Style=2
   PROCEDURE Init
      thisform.myCB.AddItem('One')
      thisform.myCB.AddItem('Two')
      thisform.myCB.AddItem('Three')
   PROCEDURE myCB.Click
      KEYBOARD '{Alt+DNARROW}'
ENDDEFINE

Bye, Olaf.

Olaf Doschke Software Engineering
 
It fails to close on item choice, but I think there'd be ways to find out when a click means selection of an item and when it means to drop down, perhaps let it depend on a state "React" you set and unset in DropDown and Valid events:

Code:
oForm1=NEWOBJECT("form1")
oForm1.SHOW()
READ EVENTS
 
DEFINE CLASS form1 AS Form
   ADD OBJECT myCB As Combobox WITH FontSize=30,Height=50,Width=150,Style=2,React=.T.
   PROCEDURE Init
      THISFORM.myCB.AddItem('One')
      THISFORM.myCB.AddItem('Two')
      THISFORM.myCB.AddItem('Three')
   PROCEDURE myCB.Click
      IF This.React
         KEYBOARD '{Alt+DNARROW}'
      ENDIF 
   PROCEDURE myCB.DropDown
      This.React = .F.
   PROCEDURE myCB.Valid
      This.React = .T.
      RETURN DODEFAULT()
ENDDEFINE

Bye, Olaf.


Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top