Click here to Skip to main content
15,881,812 members

Comments by Member 8819196 (Top 4 by date)

Member 8819196 16-Apr-12 7:00am View    
Just to clarify, if I try:

Margins margins = pageSettings.Margins;
Properties.Settings.Default.Margins = margins;
Properties.Settings.Default.Save();

it works without problems: at restart it reloads margins correctly.
But if I try to save the whole PageSettings in one move, it fails.
Member 8819196 16-Apr-12 6:42am View    
No, I'm sorry. I've just tried something like:

PrintDocument doc = new PrintDocument();
doc.DefaultPageSettings = pageSettings;
Properties.Settings.Default.Doc = doc;
Properties.Settings.Default.Save();

but at reload of application Properties.Settings.Default.Doc is null. :-{
Member 8819196 15-Apr-12 18:33pm View    
Obviously this is only simplified test code, just to show the problem. In real application I load Properties.Settings.Default at application init, then set and save at application shutdown, but it silently refuses to save (or to load?) PageSettings, while it correctly saves and reloads other objects and variables (not all, I dont understand which and why...)
Member 8819196 15-Apr-12 1:52am View    
Sorry, I only have pasted two pieces of test code, just to show the problem, forgetting to fix the "collision". But I can assure that this is not THE problem... :-\