Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

on load isn't executed

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Håvard Olerud Eriksen - 17 Mar 2008 22:16 GMT
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
harborsparrow - 18 Mar 2008 00:50 GMT
On Mar 17, 5:16 pm, Håvard Olerud Eriksen
<hoerik...@SPAMMENOTgmail.com> wrote:
> 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
[quoted text clipped - 6 lines]
> Thanks in advance,
> Håvard

Hi -

You should be able to see where the Load's handler (method) gets
registered in the "hidden" code within the page's Designer.cs file.
Search on += and if it's missing, you can add it back by hand (look at
one of the other += statements in the designed to see the syntax).
Also, in VS 2005, you can register an event in the Window Designer by
selecting (in the properties window pane) the lightning bolt icon.  I
don't know if that's still there in 2008 or not.
Cor Ligthert[MVP] - 18 Mar 2008 06:48 GMT
Havard,

You know that On Load fires only one time?

Cor

> 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
[quoted text clipped - 7 lines]
> Thanks in advance,
> Håvard
Håvard Olerud Eriksen - 18 Mar 2008 23:16 GMT
> 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
>
[quoted text clipped - 9 lines]
>> Thanks in advance,
>> Håvard

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.