By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,101 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,101 IT Pros & Developers. It's quick & easy.

restore form size after log out

P: 36
I have problem with C# application, if I switch from current account or let pc until account log out and then log on I found that form size change, for example Form size before log out is {Width=1024, Height=768} and after is {Width=1024, Height=690} there is no any code do something like that, also I try to reset form size at Event FormPaint but value still {Width=1024, Height=690} and doesn't apply change.
Dec 29 '08 #1
Share this Question
Share on Google+
12 Replies

Expert 100+
P: 221
If you want to remember the form size, when the program exits try storing the current form size in the Application settings. You can then resize the form to the last known size in the Form_Load event.
Dec 29 '08 #2

P: 36
Program still running but the size of the form change after widows stand by. This is what I mean by restore form size.
Dec 29 '08 #3

Expert 5K+
P: 7,872
Your forms change size when the computer is put in standby?
Mine don't?
Dec 29 '08 #4

P: 36
Your forms change size when the computer is put in standby?
yes ,
Dec 29 '08 #5

Expert 5K+
P: 7,872
Well, I just checked and "STANDBY" does NOT trigger any resizes.
How about you explain your situation exactly, something else must be happening to cause the resizes
Dec 29 '08 #6

P: 36
Form doesn't change its size expect when windows reach to stand by or when I go to Logoff at start menu then switch user then log on to the same account .

Only these two cases change the form size
Dec 30 '08 #7

P: 13,264
What happens when you minimize and maximize the form? Does it keep it's original size?
Dec 30 '08 #8

Expert 5K+
P: 7,872
I cannot test switching users resizing the windows as my current configuration does not allow it. In the past however there has never been an issue of my windows being changed when I switched users.
I still suspect something is not being comminucated correctly here.
Dec 30 '08 #9

P: 36
Then, how can I solve this problem?

Form size before standby is full screen i mean that task bar doesn't appear after stand by window form just maximized not full screen task bar appear . All controls size depend on the form is full screen
Dec 30 '08 #10

Expert 5K+
P: 7,872
Ah ok, so you are doing some sort of windows message override to have it cover up the taskbar then? Probably something to do with how you are doing that then, since it's not a normal behavior
Dec 30 '08 #11

Expert 100+
P: 229
You can try handling the Form.SizeChanged event to restore the window size when it changes, but it looks like the size is being changed somewhere else in your code.

You could try looking for all references to .Size, .Width, .Height in your code just to make sure that you don't change the size yourself in response to some event.
Dec 31 '08 #12

P: 36
So you are doing some sort of windows message override to have it cover up the taskbar. NO I didn't do that .there is no code override hiding Taskbar.
I just set form window state to maximized with size 800,600

I try to display message box display with form size at form Resize event

There are some thing wrong happen:
Message box shown four times before form appear with four sizes
First is: 1030,684
Seconed: 1024,786
Third: 1024,684
Fourth: 1024,786

Then i switch user and re login
And Message box display twice
First with size: 1024,780
Second: 1024,690
Dec 31 '08 #13

Post your reply

Sign in to post your reply or Sign up for a free account.