Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Toolbar in Top-Level Form
Message
 
À
09/09/2008 11:16:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01345973
Message ID:
01346142
Vues:
22
Hi William,

>One other question. Is it possible to get the toolbar to resize with the form?

Sure, you only have to remember that the toolbar size is driven by the size of the contained controls. You need to change the size of the container, instead of the toolbar. The following sample code demonstrates this. 25 is just a approximation of the space needed for the toolbar border and the like:
Public ox
ox = CreateObject("Form1")
ox.Show()

Define class form1 as form
	oTlb = NULL
	ShowWindow = 2
	Procedure Activate
		If IsNull(This.oTlb)
			This.oTlb = NewObject("Toolbar1")
			This.oTlb.HandleResize(This)
			This.oTlb.Show()
			This.oTlb.Dock(0)
		EndIf
	EndProc 
	Procedure Resize
		If not IsNull(This.oTlb)
			This.oTlb.HandleResize(This)
		EndIf 
	EndProc
EndDefine 

Define Class Toolbar1 as Toolbar
	ShowWindow = 1
	Add Object cnt as Container with BackColor = Rgb(255,0,0), Height = 25
	Procedure HandleResize( toForm )
		This.cnt.Width = m.toForm.Width - 25
	EndProc 
EndDefine 	
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform