C++ MFC

Moderators: Lundin
Number of threads: 3337
Number of posts: 9005

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to update an edit box control durning run time Posted by tipjg on 26 Jan 2011 at 6:55 PM
Hey,
I am new to MFC and I am working on this existing project where there is a button and when you click this button another dialog opens that has four different tabs. My job is to save data entered in an edit box on one of the tabs if the send button on the same tab page is clicked and show the saved data when the dialog is opened again. If the send button is not clicked I need to set the edit box data to a default value and show it when the dialog is opened again. I have this working when the user changes between tabs by placing methods in the OnShowWindow(). However, this method is not called when the dialog is closed via the close button or the "x" on dialog. Once the dialog is closed and opened back up it opens the dialog showing the last tab viewed before closing the dialog. With this in mind, I plcae some methods in the close button and in debug the methods are executed correctly but the edit box on the tab is not updated with the correct data when the dialog is opened. Is there any way to do this? Any help will be great!!!
Report
Re: How to update an edit box control durning run time Posted by AsmGuru62 on 27 Jan 2011 at 4:58 AM
When every tab is activated/deactivated or dialog is closed/open this function will be called:

http://msdn.microsoft.com/en-us/library/1f31c334(VS.80).aspx

You need to override it with your own and process data there. If tab is activated - you put the data into edit box, if it is being deactivated - you get the text out of box and save it so it can be restored later when dialog is open.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.