Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Toolbar in Top-Level Form
Message
 
To
09/09/2008 11:16:09
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01345973
Message ID:
01346142
Views:
21
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform