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

custom toolbar button does not work

Status
Not open for further replies.

gteran

Programmer
Jul 1, 2003
8
0
0
MX
Hello,

I made my toolbar with the class designer, I added the buttons, added the pictures and tried to use some actions from the standard toolbar, I tried with "print", so using sys(1500,'_MFI_SYSPRINT','_MFILE'), I thought It will do the trick.

I also made my own menu, so, if I try to print using my toolbar, when I use my own menu it does not work, but using the standard menu it works.

How can I make my toolbar and my menu work together?
Thank you very much
 
The easiest way is to make the toolbar controls call on
the menu accelerator key(s) directly. Although for some
key combos you'll get a noticeable flicker.

Darrell

i.e.

[tt]
Public oTbr
oTbr = createobject("MyToolBar")
oTbr.visible = .t.

Define class MyToolBar as toolbar
Caption = "Sync toolbar with menu"

Add object cmdFileNew as commandbutton with;
caption = "File New"

Add object cmdFileMenu as commandbutton with;
caption = "File Menu"

Add object cmdSpellCheck as commandbutton with;
caption = "Spell Check"

Add object cmdHelpSearch as commandbutton with;
caption = "Help Search"

Procedure cmdFileNew.click
Keyboard "{ctrl+n}"
Endproc

Procedure cmdFileMenu.click
Keyboard "{alt+f}"
Endproc

Procedure cmdSpellCheck.click
Keyboard "{alt+t}S"
Endproc

Procedure cmdHelpSearch.click
Keyboard "{alt+h}s"
Endproc

Enddefine
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top