Paul, Forgot to say, the button on the form is visible on the form as soon as it is created on my system VFP9 SP1.
You only need to make an object visible if you create it using CreateObj or equivalent so I can't help you there and I would think it is a video card/driver problem. Try the obvious, quit VFP then reload first though. Dave Crozier The secret to staying young is to live honestly, eat slowly, and to lie about your age -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Newton Sent: 02 November 2006 14:43 To: [email protected] Subject: Re: Return value from form created in code Dave Tx for the reply. I have been playing around with your code for a few minutes and have two questions. 1. How would you modify the code to make the form modal ? 2. Why is the "Close" button invisible until I grab and move the form with the mouse ? I have tried putting btnClose.Visible = .T. in various places and am getting some weird results (like the form background not showing) TIA Dave Crozier wrote: > Paul, > Mistake in your coding in that you don’t pass the "init() parameter" > as a string > > Also you can use non modal forms to do the same thing - just as an > aside - see below! > > * Returning data back from a non modal form > * > ? Create_Form("Hello") > > *********** > * Create the Form and return Back Values > * > Procedure Create_Form(pcVar) > Local o > Local lnRetVal > > o = CREATEOBJECT("MyForm", pcVar) > o.Show(2) > > Do While .t. > DoEvents > Wait Window Nowait Noclear o.nStatus > If o.nStatus=-1 > lnRetval=o.cRetvar > Release o > exit > Endif > Enddo > * > Return lnRetVal > > > ************ > * Form Class > * > DEFINE CLASS MyForm AS Form > Add Object btnClose as CommandButton > > cRetVar = 0 > nStatus=0 > > PROCEDURE Init() > PARAMETERS tcRetVar > This.btnClose.Caption="Close" > =BindEvent(This.btnClose,"Click",This, > "SomeProcThatSetsTheReturnValue") > > THIS.cRetVar = tcRetVar > ENDPROC > > PROCEDURE SomeProcThatSetsTheReturnValue > This.cRetVar="Hello Modified" > STORE -1 TO THISFORM.nStatus > ENDPROC > * > ENDDEFINE > > [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

