Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to trap a change in a ListBox after a MESSAGEBOX()
Message
From
13/03/2016 09:02:45
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
13/03/2016 08:49:20
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01632877
Message ID:
01632961
Views:
49
>>#1 Messageboxes are to complain. Messageboxes act in a way that interupt normal behaviour of the program (try to close any program with messagebox open, for example) that there use should be very limited. There are not designed to give each and any information.
>
>Well, no, and that's why they have "Yes", "No", "Cancel" buttons, and Info, warning, error icons... And they can be gently timeoutted too...
>
>>#2 As I've told you. If it is a bug or not changes nothing. Try to ask M$ to fix it.
>
>That ship has long sailed...
>
>>#3 A workaround I can think of (to do something constructive)
>
>Now, go to check your profile, get a (hopefully current) postal address, and start thinking of a nice Coimbra's postcard to send to you!
>
>Thanks a lot! It's a solution and that's what I came here for!

(_ _) ; contact is valid.

I always think one need to understand why.
You should run the form (with my code) against the debugger and set eventtracking on (to debugout window). The DEBUGOUT inserts moments of interest to it. (One of the reasons I like this approach)

Try to run the code with and without the messagebox. There you see the slight changes in the event sequence. The trick is to figure out what is changed and set a property at the right places.

This shows you that GOTFOCUS is the place to intercept. There I've started to fiddle around with changes to LISTITEM, REFRESH, VISIBLE and so on - to no success. After that I've introduced the asynchronous timer.
The biggest problem is that GOTFOCUS will not execute the REFRESH, for whatever reason. So the asynchronus timer will do. 10ms should no be visible. You might try shorter. Watch out to do the timer.enable as the very last action in the GOTFOCUS
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform