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

How I Can Add Tool Bar to a Form

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How I can Add FoxPro-6 Build ToolBar to any form. I have Build this one from Project Manager but can not add it to my Main Form.
 
you might read

How to make myMenu appear in myForm
faq184-844
-Pete
 
Ahsan Rana (Visitor)

Add FoxPro-6 Build ToolBar

Is this a FoxPro system toolbar or a toolbar that you have created?

Chris :)
 
This is my our build toolbar build through VFP-6

Could not open and read FAQ 184-844
 
You may have to join the forum before you can read FAQs. But here's the text of the FAQ:

To make menu appear on a user form....
*********************************************************
1. Open the menu (modify menu), the menu gets opened with the wizard...
then ...
Choose from the system menu..View..GeneralOptions.
Select Top-Level Form... Click OK

2. Again from the system menu ... choose ...
Menu... Generate... Generate
This will generate the menu mpr file

3. Now open the main form.
Set in the properties,
ShowWindow = 2 && As top level form

In the InitEvent of the form.. put the code
DO myMenu.MPR WITH THIS

4. Compile and run
==========================================

BTW, there's no reason *not* to join. I'm sure there will be other times you'll want to ask questions.

Dave Dardinger
 

xtra FYI:

1.
toolbars apply to formsets only.

2.
you cannot dock it to the form, only the visual foxpro screen. do a search in keywords and you'll find some discussions on the matter.



 
Ahsan Rana (Visitor)

You need to ensure the library containing your toolbar class is available through SET LIBRARY TO etc

DO mainmenu.mpr && Main menu

tbrMain = CREATEOBJECT([tbrMain])

WITH tbrMain
[tab].Dock(0,0,0)
[tab].Show()
ENDW

DO FORM mainform NAME oMain LINKED
READ EVENTS

itflash

toolbars apply to formsets only.

not so in VFP 6.0 and above, (can't remember when the change took place).

Chris :)
 
sorry, forgot, cheers :)
something only applies to formsets, cannot remember what it is now.

 
itflash

Just to clarify, Ahsan Rana's question is 'How I Can Add Tool Bar to a Form', and the actual answer is no, you can't add a toolbar to a form.

The problem with toolbars apply to formsets only is that it implies you can't use a toolbar outside a formset, which is not the case.

You could well be right in saying you can still add a toolbar to a formset, which might be an alternative option for Ahsan Rana. (I personally wouldn't even entertain the idea).

The code is the preceding post opens a toolbar in the _SCREEN, docking the toolbar at the top under the menu, with .Left = 0, and .Top = 0.

That is what I assume Ahsan Rana wants to achieve - if not a formset is going to be the only option.

Chris :)
 
Just to clarify things...

Just think of a toolbar as a dockable form. You can't add a form to another form and then treat the form as a part of the other form. You can only add an object reference of a form to another form as a property.

This also goes for adding forms and toolbars to a formset.
When adding a toolbar to a formset, it is treated as a dockable form and added to the forms collection of the formset (this also goes for the _SCREEN object) which stores an object reference to the form.

When you want to have a toolbar like look in a form, you'll probably have to fiddle around a bit with command buttons at the top of the form, making it look like an undetachable toolbar.

Creating a menu on top of that, will probably give the right look to your form.

HTH,
Weedz (Wietze Veld)
My private project:Download the CrownBase source code !!
 
If you really want the toolbar to appear to be contained within the form, use:-

tbrMain.Dock(-1,x,y)

where -1 means no dock and x and y are the left and top properties of the toolbar.

You can then position the toolbar anywhere within the form.

The conventional layout is:-

menu
toolbar(s)
form

and this would give you:-

menu
form
toolbar(s)

Chris :)
 
Thanks for your detailed reply but I am still little confused. I have a toolbar "Ah1" and a formset "Main" and I want when I run main form "Ah1" toolbar display with this form under its menu. Now where what I have to do. Where I write code etc.

Thanks in advance
Ahsan Rana
 
Dear Friend,
Never be disharted with VFP, I know sometimes people don't answer what you want but definately there is a solution.


Use ActiveX Controls and Select Microsoft ToolBar Control.
Once you get this on to a form. rightclick and set the toolbar properties. I would recommend Visual Foxpro 7 because you can almost do anything without much struggle as it will popup for all the properties you can use with ActiveX controls etc.

Aslam Abbas
aslamabbas@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top