Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setfocus method changes visibility of the form
Message
 
To
05/03/2007 09:07:58
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01200689
Message ID:
01200840
Views:
27
Teşekkür ederim.


>>>>Following code part raises a "cannot change modality of visible form" error, because of setfocus method change visibility of the form from hide to visible. To solve this problem I manually change the form to hide mode manually. Is there any alternative way to fix this problem.
>>>>
>>>>Best regards
>>>>
>>>>Ali Altun
>>>>
>>>>
>>>>do form "form1.scx" name oMyForm noshow
>>>>oMyForm.text1.setfocus()
>>>>** oMyForm.hide = .T. && this line is used to fix the problem
>>>>oMyForm.show(1)
>>>>
>>>
>>>
>>>do form "form1.scx" name oMyForm noshow
>>>oMyForm.text1.tabindex = 1
>>>oMyForm.show(1)
>>>
Cetin
>>
>>Tabindex solved this problem. But I don't want to modify tabindex of objects, due to prevent side effect of tabidex changing.
>
>Then setfocus from show method by overriding it and sending the member as parameter to show. ie:
>
>
>DO FORM form1 NAME oMyForm noshow
>oMyForm.Show(1,oMyForm.Text1)
>
>*!* Overridden show
>*!*	LPARAMETERS nStyle, oSetFocusTo
>*!*	IF TYPE('oSetFocusTo') = 'O' AND PEMSTATUS(oSetFocusTo,'SetFocus',5)
>*!*	  DODEFAULT(m.nStyle)
>*!*	  NoDefault
>*!*	  oSetFocusTo.SetFocus()
>*!*	endif
>
Cetin
Previous
Reply
Map
View

Click here to load this message in the networking platform