Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: Old bug - releasing the form from toolbar
Message
From
04/10/2005 10:40:37
 
 
To
29/09/2005 02:20:26
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
01054353
Message ID:
01055873
Views:
10
I submitted this for you. I see the same behavior back to VFP5, where we introduced top-level forms.

An easy workaround is to undock the toolbar before releasing the form:
procedure btn.click
	This.parent.Dock(-1)
	_SCREEN.ActiveForm.Release()
endproc
>Hi,
>
>Still can't release form using button on toolbar. Try to create a form with toolbar with a button. In the button's click event release the form.
>After click the form is still on screen and no way to close it.
>
>Here is the sample code:
>
>
>local f1
>f1 = createobject('frm')
>f1.show
>read events
>
>* ----------
>define class frm as Form
>
>	AutoCenter = .t.
>	ShowWindow = 2
>	Toolbar = ''
>
>	procedure Init
>		ThisForm.Visible = .t.
>		ThisForm.Toolbar = createobject('tbr')
>		ThisForm.Toolbar.Dock(0)
>		ThisForm.Toolbar.Show
>	endproc
>
>	procedure Release
>		ThisForm.Toolbar = .NULL.
>	endproc
>
>	procedure Unload
>		clear events
>	endproc
>
>enddefine
>
>* ----------
>define class tbr as Toolbar
>
>	ShowWindow = 1
>
>	add object btn as CommandButton;
>		with Width=100, Height=25, Caption="Close window"
>
>	procedure btn.Click
>		_SCREEN.ActiveForm.Release()
>	endproc
>
>enddefine
>
>
>This bug force me to include a timer on the form and release the form from timer event. Toolbar's button only starts the timer.
>
>Best,
>
>Janusz Czudek
>WORD Software
>http://www.wordsoft.com.pl
Jim Saunders
Microsoft
This posting is provided “AS IS”, with no warranties, and confers no rights.
Previous
Reply
Map
View

Click here to load this message in the networking platform