Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: Samir H.
  Where is Samir H.?
 Yogyakarta
 Indonesia
 Samir H.
 Tags
Subject: RE: Form with showWindow 0 and 2?
Thread ID: 310856 Message ID: 310869 # Views: 39 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Sunday, June 26, 2011 12:50:14 PM         
   


> > Hi
> > I have a form (a scx run with DO FORM, not createobject()) that I run as a usual form in my app, with showWindow=0 (in Screen).
> >
> > Now, I must also run this form as a "separate app" for guests who do not have access rights to any other function of my application. They are only allowed to run this single form.
> > In this case the form must run as showWindow=2 because the screen, the menu and all other application facilities must not be accessible to the user.
> >
> > Since the "ShowWindow" property is readonly at runtime, I had to set it to 2 (top level) for both cases, but I would like to keep it 0 (InScreen) when the form is run from within my application, and have it set to TopLevel when a guest uses the form.
> >
> > Is there any trick to change ShowWindow at runtime?
> >
> >
> > Regards
> > Samir
>
> Thank you Anil & Tushar,
> I was aware of both your solutions, I somehow hoped someone may have a magic trick (:-)) to do that with 1 scx file. I'll wait and see, otherwise I may use Tushar's suggestion.
>
> Regards
> Samir

showWindow is always readonly at runtime.try this:
local y
y=val(inputbox("top level form (1)-screen form (2)","","1"))
if !inlist(y,1,2)
return .f.
endi

publi yform
do case
case y=1
yform=newObject("asup1")
case y=2
yform=newObject("asup2")
endcase
yform.show
read events

DEFINE CLASS asup1 AS form
	ShowWindow = 2
	AutoCenter = .T.
	Caption = "this is the top level form"
	Name = "Form1"
procedure destroy
clea events
endproc
ENDDEFINE

DEFINE CLASS asup2 AS form
	AutoCenter = .T.
	Caption = "this is the screen form"
	Name = "Form1"
	procedure destroy
clea events
endproc
ENDDEFINE


Regards
Yousfi Benameur

ENTIRE THREAD

Form with showWindow 0 and 2? Posted by Samir H. @ 6/26/2011 6:18:42 AM
RE: Form with showWindow 0 and 2? Posted by Anil Sharma @ 6/26/2011 8:31:30 AM
RE: Form with showWindow 0 and 2? Posted by tushar @ 6/26/2011 9:25:22 AM
RE: Form with showWindow 0 and 2? Posted by Samir H. @ 6/26/2011 10:55:54 AM
RE: Form with showWindow 0 and 2? Posted by Yousfi Benameur @ 6/26/2011 12:50:14 PM
RE: Form with showWindow 0 and 2? Posted by Samir H. @ 6/26/2011 1:31:27 PM
RE: Form with showWindow 0 and 2? Posted by onytoo @ 6/26/2011 11:01:28 PM
RE: Form with showWindow 0 and 2? Posted by Samir H. @ 6/27/2011 5:59:20 AM