on load isn't executed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?iso-8859-1?Q?H=E5vard_Olerud_Eriksen?=

    on load isn't executed

    I've got a WinForm MDI application. A little while ago (probably after I
    made some changes) my Load method for the form stopped being executed. I had
    some initialization done there and I suddenly noticed that this wasn't done
    anymore. I haven't been able to get it to work again and have had to move my
    code to OnShown instead. Does anyone have an idea why this is happening? All
    I've got there now is a MessageBox.Show but this doesn't show.
    The application has been written using VS 2008, C#

    Thanks in advance,
    Håvard

  • Cor Ligthert[MVP]

    #2
    Re: on load isn't executed

    Havard,

    You know that On Load fires only one time?

    Cor


    "Håvard Olerud Eriksen" <hoeriksen@SPAM MENOTgmail.coms chreef in bericht
    news:%237u0oRHi IHA.4744@TK2MSF TNGP06.phx.gbl. ..
    I've got a WinForm MDI application. A little while ago (probably after I
    made some changes) my Load method for the form stopped being executed. I
    had some initialization done there and I suddenly noticed that this wasn't
    done anymore. I haven't been able to get it to work again and have had to
    move my code to OnShown instead. Does anyone have an idea why this is
    happening? All I've got there now is a MessageBox.Show but this doesn't
    show.
    The application has been written using VS 2008, C#
    >
    Thanks in advance,
    Håvard

    Comment

    • =?iso-8859-1?Q?H=E5vard_Olerud_Eriksen?=

      #3
      Re: on load isn't executed


      "Cor Ligthert[MVP]" <notmyfirstname @planet.nlwrote in message
      news:9393448B-092A-4FB3-A627-FD2714F371BD@mi crosoft.com...
      Havard,
      >
      You know that On Load fires only one time?
      Yes, I know that but it doesn't seem to be fired at all. If it had my single
      MessageBox.Show () would be shown wouldn't it? What I'm doing is that I'm
      showing a login window in the constructor of the mdi form (main form). If
      invalid login credentials are entered or the user clicks cancel I want to
      shut down the application. This worked previously when my Load fired
      properly but now that I'm using the same code in OnShown there's a "flash"
      of the main window before it closes (for obvious reasons) and I want to
      avoid that. If you have any other, better ideas on how to solve this, I'm
      all ears :)

      Håvard
      >
      Cor
      >
      >
      "Håvard Olerud Eriksen" <hoeriksen@SPAM MENOTgmail.coms chreef in bericht
      news:%237u0oRHi IHA.4744@TK2MSF TNGP06.phx.gbl. ..
      >I've got a WinForm MDI application. A little while ago (probably after I
      >made some changes) my Load method for the form stopped being executed. I
      >had some initialization done there and I suddenly noticed that this
      >wasn't done anymore. I haven't been able to get it to work again and have
      >had to move my code to OnShown instead. Does anyone have an idea why this
      >is happening? All I've got there now is a MessageBox.Show but this
      >doesn't show.
      >The application has been written using VS 2008, C#
      >>
      >Thanks in advance,
      >Håvard
      >

      Comment

      Working...