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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to create a toolbar-button with, against in, little select-button

Status
Not open for further replies.

Nifrabar

Programmer
Mar 16, 2003
1,343
NL
Hi!
Is there anyone who did this before?
In some MS-progs like Word and Excel there is a little 'button with arrow' which gives additional funtionality. E.g different front- or back-groundcolor may be selected using that 'arrow-button'.
Can we get same functionality with VFP9?
-Bart
 
Hi Tamar,
Thanks for your reply.
Indeed there's not such a control.
But the thing now is how to create yourself?
Will look alike be same as with XP-theme?
Most difficult seems to be getting the look of both controls together once th emouse moves over one of these two.
-Bart
 

Bart,

As Tamar said, it should be possible to create this yourself, but it's not quite as easy as you might at first think.

What you really need is two buttons, held together in a container. The larger of the two contains a simple caption or picture, and performs an action in the click event.

The smaller button contains a graphic representing a down-pointing arrow. When the user clicks on this, a menu opens just below the button. So far, so easy.

The difficulty is that, while the menu is open, the small button must remain depressed -- even if you move the mouse away from it. That suggests that you should perhaps be using a graphical checkbox instead of a command button.

But another difficulty is that, if you click anywhere else on the screen -- even outside your application's window -- the small button must become unclicked and the menu disappear. To achieve that, you would have to constantly monitor the mouse.

Of course, you don't have to design the button that way. But if you look at applications like Word and Outlook, that's how similar buttons behave.

Mike




__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,

Thanks for your comprehensive explanation.
After reading your information most difficult seems to catch a click outside the application.
But as far as I remember there are API's which might be used to catch.
As I am building a brandnew application now which I want to extend with all things I learnt in the past few years I'm afraid to give the development of this control some less priority until the application is almost ready.
Nevertheless thanks for your willingnes to explain.

-Bart
 
Bart,

Are you refering to somehting like this?

At the bottom picture? I did this using a .net component I created in Visual Studio 2005 and made an activex with it, and used it in VFP. (Sorry for the French part of the text).

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Mike,
Thanks for your reply and, as for many other Dutch of my age, it's not a real problem you'r using French language in that article.
But as I stated before, as this subject will take some much time related to the work stil to be done for this project I'm going to give it a try at a later stage.
Anyway thanks for your helpness.
-Bart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top