Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OleMonthView disabling my exit button
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
OleMonthView disabling my exit button
Divers
Thread ID:
00533264
Message ID:
00533264
Vues:
43
We have an application where its necessary to enter in dates. In an issue of FoxPro Advisor (nov 2000) we learned of an easy way to make a pop up calendar using activeX. It is the first time I've used ActiveX but I managed to get the calendar to work. As customers can be lazy, I wanted to allow for the popup calendar to exit (this.parent.release) when they clicked off of the calendar (lostfocus event) or when they hit the escape key. In FPA nov 2000, Mark Miller handles all this save for the fact that the oleMonthView (renamed oleCalendar) is made into a class and another class (a modified command button) is used to initalize and call the oleCalendar. Problem is this class is modal, and thus one can't click off and invoke the LostFocus event.

We tried to change the property of show(1) to show(2) but that didn't work. Finally, I came to the conclusion that being a class was causing it to act funny, so I just kept the oleCalendar as a form. Everything worked fine except, when I went to close the oleCalendar (either through exiting or inputting the date) I could no longer close the form that had called the oleCalendar.

Form_App has a cmd button that when clicked opens up a Form_Calendar (which is invis but has oleCalendar on it). oleCalendar is modeless, and has a keystroke even that accepts the esc key to exit or the enter key to input the current date selected into the text control oleCalendar is linked to (user defined property tells oleCalendar where to put the date). Additionally, as its modeless when it goes out of focus, it is set to exit. After being called and Form_Calendar is closed, Form_App will not exit. I have a cmdbutton that should exit from Form_App and this button worked before I call Form_Calendar, but not afterwards. I have other forms on Form_App and no problems with them, which leads me to think that this is an ActiveX based problem.

Anyone know of possible reasons that as to why Form_App's exit cmd button doesn't want to work after form_calendar (containing an oleMonthView activeX control)?

Form_App's exit button is part of a class and its actives on a click event and executes the following:

* --
* Tool_Close
* --
if tool::OkToMove()
* --
if thisform.Local_Close
_screen.ActiveForm.Close()
endif
* --
* --
flush
_screen.ActiveForm.release()
* --
endif
* --

when oleCalendar exits it uses this.parent.release() to close Form_Calendar (and in doing so itself...)

Any help?

matt
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform