restore form size after log out

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MarwaAlSagheer
    New Member
    • Nov 2008
    • 36

    restore form size after log out

    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
    Recognized Expert New Member
    • Mar 2008
    • 221

    #2
    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.

    Comment

    • MarwaAlSagheer
      New Member
      • Nov 2008
      • 36

      #3
      Program still running but the size of the form change after widows stand by. This is what I mean by restore form size.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Your forms change size when the computer is put in standby?
        Mine don't?

        Comment

        • MarwaAlSagheer
          New Member
          • Nov 2008
          • 36

          #5
          Your forms change size when the computer is put in standby?
          yes ,

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            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

            Comment

            • MarwaAlSagheer
              New Member
              • Nov 2008
              • 36

              #7
              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

              Comment

              • r035198x
                MVP
                • Sep 2006
                • 13225

                #8
                What happens when you minimize and maximize the form? Does it keep it's original size?

                Comment

                • Plater
                  Recognized Expert Expert
                  • Apr 2007
                  • 7872

                  #9
                  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.

                  Comment

                  • MarwaAlSagheer
                    New Member
                    • Nov 2008
                    • 36

                    #10
                    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

                    Comment

                    • Plater
                      Recognized Expert Expert
                      • Apr 2007
                      • 7872

                      #11
                      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

                      Comment

                      • vekipeki
                        Recognized Expert New Member
                        • Nov 2007
                        • 229

                        #12
                        You can try handling the Form.SizeChange d 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.

                        Comment

                        • MarwaAlSagheer
                          New Member
                          • Nov 2008
                          • 36

                          #13
                          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

                          Comment

                          Working...