In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
here i am again. I create a form at runtime and i show it in modal form. It's ok, nice. After the form is closed, is there a way to show it again? for example: FUNCTION Test() LOCAL oDlg WITH OBJECT oDlg := TForm():Create() :lCentered := .T. ...bla, bla, bla... End oDlg:ShowModal()
...bla, bla, bla... oDlg:ShowModal() // <<--- i know it does not work. ...bla, bla,bla... RETURN something. Tks,
Roberto, > FUNCTION Test() > LOCAL oDlg > > WITH OBJECT oDlg := TForm():Create() Do not call :Create() for a form, call :New() instead: WITH OBJECT oDlg := TForm():New() > :lCentered := .T. > ...bla, bla, bla... > End > > oDlg:ShowModal() > > ...bla, bla, bla... > > oDlg:ShowModal() // <<--- i know it does not work. > > ...bla, bla,bla... > > RETURN something. To reuse the same form, just set :lHideOnClose := .T.. That causes the form to be hidden instead of been destroyed whehn you close it, so you can call :Show() or :ShowModal() again whenever you need. -- Regards, Jose F. Gimenez http://www.xailer.com http://www.xailer.info
It worked perfect! This is an undocummented property, insn't it? nice, nice, nice product. i'm almost finish my system conversion from xharbour builder (xharbour.com) to xailer, thanks to xailer team. "Jose F. Gimenez" <jfgimenez@wanadoo.es> wrote: >Roberto, > >> FUNCTION Test() >> LOCAL oDlg >> >> WITH OBJECT oDlg := TForm():Create() > >Do not call :Create() for a form, call :New() instead: > > WITH OBJECT oDlg := TForm():New() > > >> :lCentered := .T. >> ...bla, bla, bla... >> End >> >> oDlg:ShowModal() >> >> ...bla, bla, bla... >> >> oDlg:ShowModal() // <<--- i know it does not work. >> >> ...bla, bla,bla... >> >> RETURN something. > >To reuse the same form, just set :lHideOnClose := .T.. That causes the form >to be hidden instead of been destroyed whehn you close it, so you can call >:Show() or :ShowModal() again whenever you need. > >-- >Regards, > >Jose F. Gimenez >http://www.xailer.com >http://www.xailer.info > >
I'm sorry, I always search on help using the "Index" option and nothing appear when I ask for lHideOnExit. This is the reason I said there is no documenttion about this property. Tks, again.
Roberto, The link topic 'lHideOnclose' had a typo and it was saved as 'HideOnClose'. Nothing to apologize. It was our fault. Now is fixed. Regards, -- Ignacio Ortiz de Zúñiga http://www.xailer.com "roberto" <roberto@top2.com.br> escribió en el mensaje news:478cc936$1@ozsrv2.ozlan.local... > > I'm sorry, I always search on help using the "Index" option and nothing > appear > when I ask for lHideOnExit. This is the reason I said there is no > documenttion > about this property. > > Tks, again. >
Thanks, Still about this, can you take a look at this code: FUNCTION EditCustomerForm() STATIC oForm := NIL IF oForm = NIL WITH OBJECT oForm := TForm():New() :lHideOnExit := .T. ...bla, bla, bla... END ENDIF oForm:ShowModal() RETURN NIL If I call it from a program, ok, it works (like when I'm browsing for customers and I want to see their details, for example). If I leave the browse, enter it again and call this function, nothing happens! I tried PRIVATE, GLOBAL, AssociativeArrays to keep the oForm variable but nothing worked. The idea is perfect, cause I have very complex forms created at runtime and it spend some time to be done for the first call. So, if I could save this form and reuse it again it whould be very, very fast than recreating it every time. I know, I whould create the form at design time, but I already have a full functional system working this way and I need only to know how to reuse a form that I already created. I may be doing something wrong, and I ask for help just after I tried all the ways to find a solution... and I always get a good answer here. tks, by the way, I hope you are understanding my poor English.
Roberto, Here, your code, is working nicely. Please send a sample showing the error. BTW, I guess you meant to write: :lHideOnClose := .T. Regards, -- Ignacio Ortiz de Zúñiga http://www.xailer.com "roberto" <roberto@top2.com.br> escribió en el mensaje news:478d95f3$1@ozsrv2.ozlan.local... > > Thanks, > > Still about this, can you take a look at this code: > > FUNCTION EditCustomerForm() > STATIC oForm := NIL > > IF oForm = NIL > WITH OBJECT oForm := TForm():New() > :lHideOnExit := .T. > ...bla, bla, bla... > END > ENDIF > > oForm:ShowModal() > > RETURN NIL > > If I call it from a program, ok, it works (like when I'm browsing for > customers > and I want to see their details, for example). If I leave the browse, > enter > it again and call this function, nothing happens! > I tried PRIVATE, GLOBAL, AssociativeArrays to keep the oForm variable but > nothing worked. > The idea is perfect, cause I have very complex forms created at runtime > and > it spend some time to be done for the first call. So, if I could save this > form and reuse it again it whould be very, very fast than recreating it > every > time. > I know, I whould create the form at design time, but I already have a full > functional system working this way and I need only to know how to reuse a > form that I already created. > > I may be doing something wrong, and I ask for help just after I tried all > the ways to find a solution... and I always get a good answer here. > > tks, > > by the way, I hope you are understanding my poor English. >