Click here to Skip to main content
16,016,814 members
Home / Discussions / C#
   

C#

 
GeneralRe: dotNet MDI app and win32 child forms Pin
Dave Kreskowiak10-Jun-04 4:21
mveDave Kreskowiak10-Jun-04 4:21 
GeneralRe: dotNet MDI app and win32 child forms Pin
southperthman11-Jun-04 6:17
southperthman11-Jun-04 6:17 
Questionhow do i make the value in text box permanent Pin
VIJAYPAPUPAGER9-Jun-04 3:22
VIJAYPAPUPAGER9-Jun-04 3:22 
AnswerRe: how do i make the value in text box permanent Pin
Guinness4Strength9-Jun-04 5:07
Guinness4Strength9-Jun-04 5:07 
GeneralRe: how do i make the value in text box permanent Pin
Heath Stewart9-Jun-04 5:59
protectorHeath Stewart9-Jun-04 5:59 
GeneralRe: how do i make the value in text box permanent Pin
surgeproof9-Jun-04 10:23
surgeproof9-Jun-04 10:23 
GeneralRe: how do i make the value in text box permanent Pin
Heath Stewart9-Jun-04 10:30
protectorHeath Stewart9-Jun-04 10:30 
AnswerRe: how do i make the value in text box permanent Pin
Heath Stewart9-Jun-04 6:04
protectorHeath Stewart9-Jun-04 6:04 
It's a common practice to actually serialize your controls using XML Serialization to a file. When you instantiate these controls you read your values from that file again.

The biggest problem with serialization, though, is that your controls are actually deserialized in their entirety. So the best approach for you is to use an XmlDocument or XmlTextWriter to write these values to an XML file, and read them back in with XmlDocument or XmlTextReader. Using XML files is easy in .NET, and there are actually lots of articles here on CodeProject about just what you're asking.

You could use the registry (it's strongly recommended you don't use INI files, which are not supported by the .NET FCL (framework class library)), but it's not recommended for deployment reasons. This isn't always such a bad thing if you don't require initial registry values, though. In your case, that would be true.

So whether you use an XML file or the registry, just save your text when the form is closed and read them back in when you open your form.

 

Microsoft MVP, Visual C#
My Articles
GeneralConversion of Unmanaged COM in VC++ to Managed VC++ or C# Pin
imran1899-Jun-04 2:49
imran1899-Jun-04 2:49 
GeneralRe: Conversion of Unmanaged COM in VC++ to Managed VC++ or C# Pin
Heath Stewart9-Jun-04 5:53
protectorHeath Stewart9-Jun-04 5:53 
GeneralIO completion ports and unexpected performance. Pin
Angelos Petropoulos9-Jun-04 2:36
Angelos Petropoulos9-Jun-04 2:36 
GeneralRe: IO completion ports and unexpected performance. Pin
scadaguy9-Jun-04 16:34
scadaguy9-Jun-04 16:34 
GeneralRe: IO completion ports and unexpected performance. Pin
Angelos Petropoulos10-Jun-04 1:48
Angelos Petropoulos10-Jun-04 1:48 
GeneralRe: IO completion ports and unexpected performance. Pin
scadaguy10-Jun-04 2:27
scadaguy10-Jun-04 2:27 
GeneralRe: IO completion ports and unexpected performance. Pin
Angelos Petropoulos10-Jun-04 13:25
Angelos Petropoulos10-Jun-04 13:25 
GeneralRe: IO completion ports and unexpected performance. Pin
scadaguy11-Jun-04 3:06
scadaguy11-Jun-04 3:06 
GeneralRe: IO completion ports and unexpected performance. Pin
Angelos Petropoulos11-Jun-04 3:27
Angelos Petropoulos11-Jun-04 3:27 
GeneralRe: IO completion ports and unexpected performance. Pin
k.mohan kumar28-Jan-09 20:11
k.mohan kumar28-Jan-09 20:11 
GeneralRe: IO completion ports and unexpected performance. Pin
Angelos Petropoulos11-Jun-04 1:44
Angelos Petropoulos11-Jun-04 1:44 
GeneralRe: IO completion ports and unexpected performance. Pin
scadaguy11-Jun-04 3:24
scadaguy11-Jun-04 3:24 
GeneralRe: IO completion ports and unexpected performance. Pin
Angelos Petropoulos11-Jun-04 3:37
Angelos Petropoulos11-Jun-04 3:37 
GeneralRe: IO completion ports and unexpected performance. Pin
Angelos Petropoulos11-Jun-04 5:29
Angelos Petropoulos11-Jun-04 5:29 
GeneralRe: IO completion ports and unexpected performance. Pin
Colby James Smith1-Sep-04 10:06
Colby James Smith1-Sep-04 10:06 
Questionwhat is the differcence between close and dispose with Process instance? Pin
fu09-Jun-04 2:36
fu09-Jun-04 2:36 
AnswerRe: what is the differcence between close and dispose with Process instance? Pin
Heath Stewart9-Jun-04 2:54
protectorHeath Stewart9-Jun-04 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.