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.

Pass a Parmater into a Modal form ??

Xailer professional forum in English
ChrisGillard
Mensajes: 384
Registrado: Mar May 01, 2007 5:49 pm

Pass a Parmater into a Modal form ??

Mensaje por ChrisGillard »

Hi,
I think I should know how to do this but I dont ...
When showing a Form from a button, I would like to pass in a parameter or
maybe several ??
In the form to be shown I have my code looks like this ... I have added
PROPERTY cMode
CLASS InvoiceForm FROM TForm
PROPERTY cMode INIT "" ----------- This is added by me
COMPONENT oGroupBox1
COMPONENT oGroupBox2
COMPONENT oLineBrowse
METHOD CreateForm()
METHOD FormInitialize( oSender )
ENDCLASS
My Calling code looks like this .....
METHOD NewBtnClick( oSender ) CLASS TMainForm
local oForm := InvoiceForm():New()
oForm:cMode := "ADD" ------------- but I dont think this is working ??
oForm:ShowModal()
RETURN Nil
I can put my cMode in the calling form & get the InvoiceForm to pick up from
the calling form ... but that seems poor practice.
So problem is "how to pass one or more parameters to a modal form called
from a button".
How does anyone else do this ??
Regards
Chris Gillard
Responder