Connecting Tech Pros Worldwide Forums | Help | Site Map

restore form size after log out

Member
 
Join Date: Nov 2008
Posts: 36
#1: Dec 29 '08
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.

nukefusion's Avatar
Expert
 
Join Date: Mar 2008
Location: Essex, UK
Posts: 197
#2: Dec 29 '08

re: restore form size after log out


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.
Member
 
Join Date: Nov 2008
Posts: 36
#3: Dec 29 '08

re: restore form size after log out


Program still running but the size of the form change after widows stand by. This is what I mean by restore form size.
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#4: Dec 29 '08

re: restore form size after log out


Your forms change size when the computer is put in standby?
Mine don't?
Member
 
Join Date: Nov 2008
Posts: 36
#5: Dec 29 '08

re: restore form size after log out


Your forms change size when the computer is put in standby?
yes ,
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#6: Dec 29 '08

re: restore form size after log out


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
Member
 
Join Date: Nov 2008
Posts: 36
#7: Dec 30 '08

re: restore form size after log out


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
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#8: Dec 30 '08

re: restore form size after log out


What happens when you minimize and maximize the form? Does it keep it's original size?
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#9: Dec 30 '08

re: restore form size after log out


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.
Member
 
Join Date: Nov 2008
Posts: 36
#10: Dec 30 '08

re: restore form size after log out


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
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#11: Dec 30 '08

re: restore form size after log out


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
vekipeki's Avatar
Expert
 
Join Date: Nov 2007
Posts: 231
#12: Dec 31 '08

re: restore form size after log out


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.
Member
 
Join Date: Nov 2008
Posts: 36
#13: Dec 31 '08

re: restore form size after log out


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
Reply


Similar C# / C Sharp bytes