saving history of edit box and dispalying again

hello,
        I am buliding a  dialog based  appication in which i pop up another 
modal dialog.What i want that when user enters value in the dit box of the 
second dialog,and we click OK then becaus ef UpdateData(TRUE) all the valuse 
from controls are transferred to the varaibles..Now if we close the dialog 
and reopen it again i want that the old set values ahould be diaplayed in the 
respective edit boxes of the dialog,so that user will now what values he had 
set initially.Can we do this?
please tell me how?
           
0
sayu (83)
8/1/2005 4:42:03 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
494 Views

Similar Articles

[PageSpeed] 28

You'll have to save the values in the parent dialog and each time the child 
dialog is popped up, you'll need to init the child dialog variables using 
the save data. Something like :-

CDialog child;
....
....
child.somevar1 = somevar1;
child.somevar2 = somevar2;
if(child.DoModal() == IDOK)
{
    somevar1 = child.somevar1;
    somevar2 = child.somevar2;
}

and in child's OnInitDialog, do something like this :-

m_somecontrol1.SetWindowText(somevar1);
m_somecontrol2.SetWindowText(somevar2);

-- 
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com


"sayu" <sayu@discussions.microsoft.com> wrote in message 
news:D99BBADD-F2DD-4106-956F-AF6547DB3015@microsoft.com...
> hello,
>        I am buliding a  dialog based  appication in which i pop up another
> modal dialog.What i want that when user enters value in the dit box of the
> second dialog,and we click OK then becaus ef UpdateData(TRUE) all the 
> valuse
> from controls are transferred to the varaibles..Now if we close the dialog
> and reopen it again i want that the old set values ahould be diaplayed in 
> the
> respective edit boxes of the dialog,so that user will now what values he 
> had
> set initially.Can we do this?
> please tell me how?
> 


0
nish (347)
8/1/2005 6:09:02 AM
if you do not Destructe the dialog instance, just save the values in
the child.m_somevar1/2 is ok, no external somevar1/2 is needed.

0
realfun (4)
8/1/2005 8:08:19 AM
if you do not Destruct the dialog instance, just save the values in the
child.m_somevar1/2 is ok, no external somevar1/2 is needed.

0
realfun (4)
8/1/2005 8:08:25 AM
Reply:

Similar Artilces:

Adding control boxes automatically
Hi Folks, I'm completly jammed here, I've been trying to find a way to add control box to a form by clicking a bottom. Unfortunately, I've keep failed. Could someone help me on this matter. Your help will be very appreciated That's an extremely unusual thing to have to do in a production application. Perhaps you can explain your situation, and someone will be able to suggest an alternative. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Fred's" <frederic10_mess@hotmail.com> wrote in message news:1193673833.6376...

Populate textbox form selection on combo box
Hi I am new to code I have a query that a unbound combo box is bassed on. The 4th colunm is the Ingredient ID that I would like to write to textbox Ingredient_Id I have tried Tom Lake's sugestion Private Sub Combo12_AfterUpdate() Me![Ingredient_Id] = Me![Combo12].Column3 End Sub But I get Object doesn't support this porperty or method, and I do not understand what it means. What does the "me" mean? Thank you Esrei "Me!" refers to the form in which the code is being written and I don't think it is really necessary. I think it should be: ...

daylight savings time on vlookup
DST, how do I incorporate that to the sheet? say... Arizona, they are currently in Pacific time but when California reverts back to DST, are they ahead or behind Pacific? how can i formulate that in excel sheet? I think Indiana is the same way. I'm sure you know exactly what you want, but your question is very ambiguous. XL by itself is totally unaware of time zones. How are you dealing with time and location now? How does XL know what time is referred to or what location is referred to? AFAIK, AZ and HI don't observe DST, and only some counties in IN observe it, so you'd n...

FILE SIZES/CANNOT SAVE
Hi there ! I have an excel spreadsheet with 8 wsheets which worked perfectly , and was 180k in size. However , as I REMOVE wsheets the file size INCREASES! When I leave just 3 Wsheets , each EMPTY! , the file size has quadrupled to 750K ! .. and I am unable to save/overwrite it on a floppy ! Has anyone any ideas ? ... Many thanks .... Brian NEVER save to a floppy. SAVE and COPY to the floppy. Same thing on getting file FROM floppy. Copy to HD. Then open. -- Don Guillett SalesAid Software donaldb@281.com "BRIAN BARNARD" <brian.barnard80@ntlworld.com> wrote in ...

How do you turn off "Save a copy/Overwrite changes" dialog box
Hello Guys, I have created a (password to open) workbook using Excel 2003 SP1 on a shared network drive which when I try to save by using Ctrl S or clicking the Save icon gives me an irritating dialog box which asks: "The file 'filename.xls' may have been changed by another user since you last saved it. In that case what do you want to do?" -Save a copy -Overwrite changes Please can someone tell me how to deactivate this annoying dialog box as I have been unsuccesful so far in my efforts :confused: Many thanks in advance Nick -- Nicko -----------------------------...

gridview edits requires a double click
Why is that I need to click the edit link twice, in a gridview control, before my row enters into edit mode? Is there a workaround? -- Arne Garvander Certified professional Geek "Arne Garvander" <ArneGarvander@discussions.microsoft.com> wrote in message news:637F0D30-A7B1-47DE-8141-CD9E18C5E8BC@microsoft.com... > Why is that I need to click the edit link twice, in a gridview control, > before my row enters into edit mode? > Is there a workaround? Common problem, hundreds of web pages, easily fixed: http://www.google.co.uk/search?rlz=1C1CHMA_en-GBGB3...

How do I save an Excel file in ASCII?
Mrs Crinkle wrote: Save as *.csv > How do I save an Excel file in ASCII? One way... To save formulas and values, use: Tools >> Options >> View and check "Formulas" Then: File >> Save as and choose CSV as the "Save as type" Many Excel features aren't preserved, but you'll get the basic values and formulas for one worksheet. ...

Text orientation when saved as web page
I have an Excel file and I need to save it as a web page. When I do, text that I had displayed vertically (Format/Cells/Alignment/Orientation) are displayed horizonally. How can I get the text to stay the way I want it? ...

How to save settings for my printer to print doublesided from exce
When I print doubled sided in word everything goes fine but whenever I try to print doublesided from excel and I go for advanced on my printer and check the boxes for it and then klick ok - after that I go in there to check that it's ok and then all my settings are gone.. Why and how can I change this so that I can print double sides in excel aswell? ...

Additional file with no extension created during File Save As proc
Good morning all! I originally posted this query on the Developer board, as I thought it was a problem with my code, but now I'm not so sure. I have a workbook with a macro that runs a Save As within a loop, to create test data files. I was finding that for every new file I created, and additional file with a filename comprisiong eight alphanumeric characters and no file extenson was created in the same folder. Thinking that the workbook might be corrupted, I created a new workbook (with NO copying/pasting from the original - everything types in from scratch) , created new code m...

Save Preview Picture
Is there any wat to make the file property in Excel "Save Preview Picture" checked so that it is checked on everything, rather than having to go through and check it for each file? I've googled but haven't been able to find anything. Can this be done through VBA perhaps? That property is a Workbook setting, not a global one. You could create a template with that property checked and use that template as the default workbook for new workbooks. Open a new workbook. Customize as you wish. File>Save As Type: scroll down to Excel Template(*.XLT) and select. Name you...

creating a macro for a "Save As" box
How do I create a macro that will display the "Save As" dialog box? When I create it using the the Macro Wizard, it doesn't bring up the "Save As" window. It just saves at the previous location and name. My attempts to alter the VBA code have failed. hi, add this to the macro wizard code Application.Dialogs(xlDialogSaveAs).Show regards FSt1 "MysticMarley" wrote: > How do I create a macro that will display the "Save As" dialog box? When I > create it using the the Macro Wizard, it doesn't bring up the "Save As" > w...

How to Color a Box on a Report when Change in one Field's Data
I want to have a box on a report change it's back color from one color to another and back again on every change in a field called "CollectionCode." The box is in the detail section. It is not in its own section for stylistic reasons. However, it is the first field listed in the sort. Thanks, Matt doyle60@aol.com wrote: >I want to have a box on a report change it's back color from one color >to another and back again on every change in a field called >"CollectionCode." > >The box is in the detail section. It is not in its own...

Field
I'm inputting a note in the field text box and this will be saved as the last entry. When I go back into this box, the order of the entries will be all messed up. It will be marked as 2 entries before. I don't have any sorting order on the form. It just sorts itself by computer time. It will just take the last entry and put it in 2 entries before. Please help. > =A0I don't have any sorting > order on the form. =A0It just sorts itself by computer time. =A0It will j= ust take > the last entry and put it in 2 entries before. =A0Please help. There are a c...

Outlook 2007 not saving autocorrect options
Using Outlook 2007, I turn off the "Capitalize first letter of sentences" in the AutoCorrect tab. This setting works for subsequent email, but is not saved if I close Outlook and restart it. I want to make the change stick. I have made a similar change in Word 2007 and while the setting does get saved within Word, it does not seem to affect Outlook. ...

Saving a single worksheet
Is there a way to save a single worksheet instead of all worksheets in the workbook? For instance, I have several sheets in one workbook and want to save only one of the sheets to a floppy in drive A. I know I can move or copy to a new book and then save, but is that the only way or is there an easier way? Please help - thanks Debra, What you are doing - moving or copying to a new workbook and then saving - is the best method. Writing a macro to do that for you would be easier, but won't save you that much time/effort. HTH, Bernie Excel MVP "Debra Carner" <dcarne...

Can Publisher autosave -just save latest, not for auto recover
Publisher is not prompting for saves on closing - resulting in work being lost (yes, I know, people should be manually saving, but there hjave been several instances where peope habve closed the program, expecting a save [prompt and have not receibved it. Work is being lost. Is there a way of having Publisher 2003 automatically save latest changes to a working file at set intervals? Note: autorecover saving is not the answer as this is only available if the program stalls. I am after something that simply saves the latest changes every 5-10 minutes. And prompts to save changes on closin...

Check Box
I have a file with several sheets and the first sheet is a list of every other sheet and a Check Box on the side, and I have a macro that activate sheets when I click the check box. But now I want to have a macro that click them all (there are 36) at once and Unclick them all at once. Thank in advance for your help. You may want to share more details. There are a couple of different checkboxes. Did you use the checkboxes from the Forms toolbar or the checkboxes from the Control toolbox toolbar? And if you selected all the checkboxes (or even more than one), what do you mean by activate?...

How do I change the size of the text box of data labels?
Excel does not give you the ability to resize these boxes. If you need more control, you have to use regular text boxes. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "rmashton" <rmashton@discussions.microsoft.com> wrote in message news:2779C336-3FB7-407B-A7AC-0773BE51A735@microsoft.com... > ...

Save multiple attachments
I use OL2007 and I often receieve mails with multiple attachements. Under the Save as option there have been a choice to save attached files but this option is gone. How do I reinstall it. Kindly Mariah it's now under Other Actions. "MN" wrote: > I use OL2007 and I often receieve mails with multiple attachements. > Under the Save as option there have been a choice to save attached files > but this option is gone. How do I reinstall it. > > Kindly > > Mariah Can you guide me? "dlw" <dlw@discussions.microsoft.com&...

numbers in text box
I am recieve data from a scale in text box. It has number and other carater. How I could take only number in text box. I am work with 2008. thanks for your help "Roberto Londono" <RobertoLondono@discussions.microsoft.com> wrote in message news:546A43AC-C590-42C0-BB4C-DA3C6D71FAF0@microsoft.com... >I am recieve data from a scale in text box. It has number and other >carater. > How I could take only number in text box. I am work with 2008. > > thanks for your help It depends on how you receive your data, but I did this for a similar situation. I...

Appropriate number format to dispaly time in hours in XY chart
What is the appropriate number format to display time in hours:minute:seconds in a XY chart? [hh]:mm:ss -- David Biddulph "Saritha" <Saritha@discussions.microsoft.com> wrote in message news:8F67F716-CBD7-4B3F-8B29-8B88139B1A7B@microsoft.com... > What is the appropriate number format to display time in > hours:minute:seconds > in a XY chart? ...

OL2007
Running OL2007 SP2 under Vista Home Premium SP2. It appears that when I'm replying to a plain text message, editing functions (bold, underline, etc) are disabled. Is there a way to enable them? You'd need to switch to HTML format - plain text is, well, plain text. That means no formatting. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlook and Exchan...

Problem with menu in dialog box
I have created a dialog box with a menu. Works fine, *except* that I am unable to update the menu commands: the OnUpdatexxx(CCmdUI* pCmdUI) handlers do not get called when the menu opens, however, they do get called when you click the menu item xxx, after which the xxx command handler gets called too... When this happens, the m_pMenu member of pCmdUI is null, and calling say pCmdUI->SetCheck() or pCmdUI->Enable(FALSE) has no effect whatsoever. Does anyone know how to fix this problem? Thanks, Werner On Sat, 5 Jul 2003 14:52:04 -0700, Werner Frei wrote: >Does anyone know how to fix...

What does "Save My Settings" save?
For Office XP, what exactly does the "Save my Settings" wizard save? I'm most interested in saving my toolbar configurations - i.e., what icons are visibile for Outlook Contacts, which ones for Tasks, etc. - and also all the customize preferences I select under Tools/Options - i.e., don't use Word as email editor, the font I want for Notes, etc. How do I save all those preferences? Have you tried using it and then see what output you get when you try a restore? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (...