Hi, or why not add a decoy event for a hidden button or sth like that? Just add another button event for a button that doesn't exist, have the form handler of the second form treat it as handled so that the system doesn't see it and use it as "order" to close! Best regards Tam Hanna
Subject: Re: Explicitly closing a form From: Logan Shaw <[EMAIL PROTECTED]> Date: Wed, 07 Dec 2005 12:29:07 -0600 X-Message-Number: 18 Richard Coutts wrote: > > To date I've been opening my forms using FrmDoDialog and closing most > of them by having the form handler return 'false' when a button is > pressed. Now I have a field in a form that invokes a second form when > entered. If the user selects a particular button, I want to close > both forms. I return 'false' from the second form's handler when the > button is pressed, which closes the form, but returning 'false' from > the first form's handler when the field is entered doesn't close the first form. Right, because the reason returning false closes the form is that it causes some other function to handle the ctlSelectEvent (i.e. button press), and that other function is what closes the form. > I know I can close the form by writing my own event loop to replace > FrmDoDialog, but am wondering if there's a simpler way. In the past, I've done this by picking a button on the form and simulating a button press with CtlHitControl(). Of course, that only works if you have a button on the form. - Logan -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
