Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Holding the name of a control as a string?
Message
 
To
04/03/2002 16:21:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00628023
Message ID:
00628114
Views:
24
OK really tearing my hair out - wasted a whole evening on this...

Basically I am trying to trap the user into saving or undo their changes...

I have a top level form with a tree view in it that provides my menu structure and if the data hasn't changed in the form the user can launch another form without the annoying "please close this form" message - I only want to trap them if they made changes...
local lnAnswer, strControl, loControl

if thisform.mDataChanged()
lnAnswer = messagebox('     Please Save or Undo changes before launching another screen...          ', ;
0 + 64 + 0, 'System Message')
return
endif
That works OK once! If the user exits the form stays open but if they click the treeview again the form closes and the changes are lost...

Putting in the focus to the last control causes the lost focus to fire twice and even then if the treeview is clicked the form shuts down just the same - changes lost...

Please if you have any ideas...
Chris Maiden
Email
Web
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform