> Benoît Minisini a écrit : > >> Fabien Bodard a écrit : > >>> it seem that the click event is send after the .value setting... but > >>> the MouseUp before. > >>> > >>> why did you not use the click event ? > >> > >> I don't use it because it is raised after the .Value has changed and I > >> need to be able to forbid any change in some conditions. > > > > - You can't assume any relationship between Mouse events and the Click > > event raised when the value has changed. > > That's NOW obvious, but not @ first glance and without a test to see > exactly which order is given to events. >
And because you can raise the Click event by code, or by using only the keyboard. > > - If the checkbox should not be changed, then it must be disabled before > > the user tries to change it. > > That doesn't prevent MouseDown/Up etc events to be raised Why should it? > (remember, I use > it for 2 purposes: display and set/unset; BTW, Fabien, that remember me why > I didn't used the Click event: it is also raised when the application > change the .Value of the CheckBox) > If you really have to make a difference between a change coming from the application and a change coming from the user, then use a boolean flag, like "bIgnoreClickEvent", that you set explicitely when needed. Regards, -- Benoît ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user