Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

Problem restoring main form from minimize

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike Borrowdale - 20 Jan 2008 22:07 GMT
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

--
yugip - 21 Jan 2008 00:01 GMT
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,
>
[quoted text clipped - 13 lines]
>
> Mike B
Mike Borrowdale - 21 Jan 2008 02:42 GMT
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,
>
[quoted text clipped - 24 lines]
> >
> > Mike B

--
Mike Borrowdale - 21 Jan 2008 04:09 GMT
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

> Hi yugip,
>
[quoted text clipped - 45 lines]
> > >
> > > Mike B

--
Ignacio Machin ( .NET/ C# MVP ) - 21 Jan 2008 13:50 GMT
Hi,

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

Signature

Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.

> Hi,
>
[quoted text clipped - 13 lines]
>
> Mike B

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.