[Gambas-user] Closing X in Form event?

Ron ron at ...1740...
Fri Sep 25 14:18:15 CEST 2009


If your goal is to prevent closing the form if users click the X I do this:

PUBLIC SUB Form_Close()

    IF bAuthOk = FALSE THEN STOP EVENT
 
END

So if then are not authenticated (it's a login form) then disable X button.

Regards,
Ron_2nd.
> You're right Rolf,
>
> I was under the impression that there was such an event :)
>
> sorry about that :)
>
> when you get it working would you mind pasting the code here?
>
> I'd like to take a look at it
>
> Regards
> Dimitris
>
> On Fri, Sep 25, 2009 at 4:26 AM, Rolf-Werner Eilert <
> eilert-sprachen at ...221...> wrote:
>
>   
>> Dimitris Anogiatis schrieb:
>>     
>>> hey Rolf,
>>>
>>> Is it a modal form a normal form or a dialog?
>>>       
>> It's a modal one
>>
>>     
>>> I think that in normal forms Form_Unload is the event you want but I'm
>>>       
>> not
>>     
>>> entirely sure
>>> could you give us a few more details on what you're trying to do?
>>>       
>> Well, I can't find Form_Unload. Wasn't that VB? No, what I was looking
>> for was an event referring to the X gadget of the window only.
>>
>> But I just remembered that I could do it using a flag which is set
>> clicking OK and not set clicking Cancel or something else. This flag
>> then is referenced during Form_Close. This would have the same effect
>> (if my crude logic doesn't fool me today...) :-)
>>
>> Rolf
>>
>>     
>>> Regards
>>> Dimitris
>>>
>>> On Fri, Sep 25, 2009 at 3:36 AM, Rolf-Werner Eilert <
>>> eilert-sprachen at ...221...> wrote:
>>>
>>>       
>>>> Hi all,
>>>>
>>>> which event refers to the closing X of the form?
>>>>
>>>> When I use Form_Close the code will be run even when clicking OK (and
>>>> closing the form). What I want is the same reaction like when clicking
>>>> the Cancel button without affecting OK.
>>>>
>>>> Maybe a stupid question, but 've never had this problem yet.
>>>>
>>>> Regards
>>>>
>>>> Rolf
>>>>
>>>>
>>>>
>>>>         
>> ------------------------------------------------------------------------------
>>     
>>>> Come build with us! The BlackBerry® Developer Conference in SF, CA
>>>> is the only developer event you need to attend this year. Jumpstart your
>>>> developing skills, take BlackBerry mobile applications to market and
>>>>         
>> stay
>>     
>>>> ahead of the curve. Join us from November 9-12, 2009. Register
>>>>         
>> now!
>>     
>>>>         
>>
>>> urve. Join us from November 9-12, 2009. Register
>>>       
>> now!
>>     
>>





More information about the User mailing list