Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I drop a toolbar on a form (not a formset)
Message
De
14/07/2003 09:27:15
Dorin Vasilescu
ALL Trans Romania
Arad, Roumanie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00809237
Message ID:
00809802
Vues:
25
You cannot drop it to a form, but you can have a toolbar activated in a top level form.
ShowWindow property of your toolbar class must be "In Top Level form"
Check this code:
PUBLIC oForm
oForm = CREATEOBJECT('form1')
oForm.visible = .t.


**************************
DEFINE CLASS form1 AS form
	Height = 333
	Width = 480
	ShowWindow = 2
	DoCreate = .T.
	AutoCenter = .T.
	Caption = "Form1"
	toolbarref = .NULL.
	Name = "Form1"

	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 200, ;
		Left = 290, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Command1", ;
	Name = "Command1"


	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 200, ;
		Left = 198, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Command2", ;
		Name = "Command2"

	ADD OBJECT command3 AS commandbutton WITH ;
		Top = 200, ;
		Left = 106, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Command3", ;
	Name = "Command3"

	ADD OBJECT text1 AS textbox WITH ;
		Height = 23, ;
		Left = 32, ;
		Top = 28, ;
		Width = 424, ;
		Name = "Text1"

	PROCEDURE Activate
		IF  ISNULL(this.toolbarref)
			this.ToolbarRef=CREATEOBJECT('MyToolbar')
			this.ToolbarRef.Dock(0)   && or 1 , 2
			this.ToolbarRef.visible = .t.
		ENDIF
	ENDPROC


ENDDEFINE



*********************************
DEFINE CLASS mytoolbar AS toolbar
	Caption = "Toolbar1"
	Height = 28
	Left = 0
	Top = 0
	Width = 99
	ShowWindow = 1
	Name = "mytoolbar"
	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 3, ;
		Left = 5, ;
		Height = 22, ;
		Width = 23, ;
		Caption = "a", ;
		Name = "Command1"
	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 3, ;
		Left = 27, ;
		Height = 22, ;
		Width = 23, ;
		Caption = "b", ;
		Name = "Command2"
	ADD OBJECT command3 AS commandbutton WITH ;
		Top = 3, ;
		Left = 49, ;
		Height = 22, ;
		Width = 23, ;
		Caption = "c", ;
	Name = "Command3"
	ADD OBJECT command4 AS commandbutton WITH ;
		Top = 3, ;
		Left = 71, ;
		Height = 22, ;
		Width = 23, ;
		Caption = "d", ;
		Name = "Command4"


ENDDEFINE
>Hi all
>
> I thought I did this one time. Can I drop a toolbar on a form? Not a formset but on the form.
>
>Thanks
>Gary
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform