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





_______________________________________________
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.

Reply via email to