×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Combo Box Drop Down Arrow
5

Combo Box Drop Down Arrow

Combo Box Drop Down Arrow

(OP)
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.

RE: Combo Box Drop Down Arrow

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

RE: Combo Box Drop Down Arrow

(OP)
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?

RE: Combo Box Drop Down Arrow

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 KEYBOARD "{ALT+DNARROW}" 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

RE: Combo Box Drop Down Arrow

(OP)
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.

RE: Combo Box Drop Down Arrow

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
https://www.blogger.com/profile/089031659767875220...

RE: Combo Box Drop Down Arrow

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
https://www.doschke.name

RE: Combo Box Drop Down Arrow

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

RE: Combo Box Drop Down Arrow

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
https://www.doschke.name

RE: Combo Box Drop Down Arrow

(OP)
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.

RE: Combo Box Drop Down Arrow

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 

RE: Combo Box Drop Down Arrow

(OP)
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!

RE: Combo Box Drop Down Arrow

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

RE: Combo Box Drop Down Arrow

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
https://www.doschke.name

RE: Combo Box Drop Down Arrow

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
https://www.doschke.name

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close