Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. windowstate maximized : form_activate executes before form_load

windowstate maximized : form_activate executes before form_load

Scheduled Pinned Locked Moved Visual Basic
csharphelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nishkarsh_k
    wrote on last edited by
    #1

    Hello every one, I am having a VB.net 2005 application. Earlier we had designed the application with a fixed window size, now we had implemented TableLayoutPanel in it to make it full screen. After the implementation I made Windowstate as maximized for the forms. Now I am encountering some thing strange, On formName.show first the form1_activate is executed instead of form1_load. (Openinf form1 from form) Once I reverted back “Windowstate to Normal” the execution sequence comes back to normal (Lode and then execute) Can any one plz help me out with it... Regards Nishkarsh

    D 1 Reply Last reply
    0
    • N nishkarsh_k

      Hello every one, I am having a VB.net 2005 application. Earlier we had designed the application with a fixed window size, now we had implemented TableLayoutPanel in it to make it full screen. After the implementation I made Windowstate as maximized for the forms. Now I am encountering some thing strange, On formName.show first the form1_activate is executed instead of form1_load. (Openinf form1 from form) Once I reverted back “Windowstate to Normal” the execution sequence comes back to normal (Lode and then execute) Can any one plz help me out with it... Regards Nishkarsh

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You can't change the firing order of events, so the only thing you can do is change your code to handle both cases. I have to question what code you're putting into the Activate event handler, since this event fires every time the form gets focus for any reason, not just when the form first appears. Normally, you'd use this event to update the forms controls with new data when the form regains the focus.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      N 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You can't change the firing order of events, so the only thing you can do is change your code to handle both cases. I have to question what code you're putting into the Activate event handler, since this event fires every time the form gets focus for any reason, not just when the form first appears. Normally, you'd use this event to update the forms controls with new data when the form regains the focus.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        N Offline
        N Offline
        nishkarsh_k
        wrote on last edited by
        #3

        Thanks Dave for the input. My exact question is that after making The window state to full screen in designer, why form activate is executed before load. I had done a way around now that i change the window state to full screen at the end of form load. But want to know why way it happening Regards Nishkarsh

        D 1 Reply Last reply
        0
        • N nishkarsh_k

          Thanks Dave for the input. My exact question is that after making The window state to full screen in designer, why form activate is executed before load. I had done a way around now that i change the window state to full screen at the end of form load. But want to know why way it happening Regards Nishkarsh

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          I have no idea.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups