Problem restoring main form from minimize

  • Thread starter Thread starter Mike Borrowdale
  • Start date Start date
M

Mike Borrowdale

Hi,

new to c#, using VS2008 Express to build a winforms app.

I have set a couple of Application settings to save the main form size
and location between runs. That works great. But when I minimize the
main form and then try to restore it the form size is reduced to a
minimal window with just a title bar and no client area. If I chenge
the setting so it's got Application scope then the restore works
correctly, but only to design size not user set size. I guess this last
bit is to be expected, but the form does actually restore to a size and
not to a minimal title bar. I'm sure this is a trap every newbie falls
into, but can someone help me out of it please.

Thanks

Mike B

--
 
hello mike,

can you provide the code so that it could be more clear.
i guess when you minimize the form your value (what you store) is being
changed so i will suggest you to store the value when form is initilized so
that it can not be changed later on.
anyways its just a wild guess you can try it

regards
 
Hi yugip,

no real code involved here, just settings in the IDE, so the best
minimal reprodecuer I can come up with is a set of instructions:

1. Start a new winforms project
2. Select the form in the designer and then open the properties window
3. Expand the (ApplicationSettings) entry and select (PropertyBinding)
4. Select the (...) to open the Application Settings window.
5. Find ClientSize and provide an entry for it. User scope.
5. Find Location and provide a n entry for it. User scope
6. Close the Application Settings window.
7. Run the application. Minimize the form and restore it.

It seems that both the Location and ClientSize entries are needed,
individually they work OK.

Annoying to say the least, any help would be appreciated.

Mike


hello mike,

can you provide the code so that it could be more clear.
i guess when you minimize the form your value (what you store) is
being changed so i will suggest you to store the value when form is
initilized so that it can not be changed later on.
anyways its just a wild guess you can try it

regards



--
 
OOps,

answered my own question. The overview of ApplicationSettings in VS
help says that ClientSize cannot be used in the way I'm trying to. I'll
woek around the problem and save manually.

Mike


Mike said:
Hi yugip,

no real code involved here, just settings in the IDE, so the best
minimal reprodecuer I can come up with is a set of instructions:

1. Start a new winforms project
2. Select the form in the designer and then open the properties window
3. Expand the (ApplicationSettings) entry and select (PropertyBinding)
4. Select the (...) to open the Application Settings window.
5. Find ClientSize and provide an entry for it. User scope.
5. Find Location and provide a n entry for it. User scope
6. Close the Application Settings window.
7. Run the application. Minimize the form and restore it.

It seems that both the Location and ClientSize entries are needed,
individually they work OK.

Annoying to say the least, any help would be appreciated.

Mike



--
 
Hi,

You have to check when the app is minimized, if that is the case then you
should not save those values.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top