473,890 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Mar 17 '08 #1
2 1024
Havard,

You know that On Load fires only one time?

Cor
"Håvard Olerud Eriksen" <ho*******@SPAM MENOTgmail.coms chreef in bericht
news:%2******** ********@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
Mar 18 '08 #2

"Cor Ligthert[MVP]" <no************ @planet.nlwrote in message
news:93******** *************** ***********@mic rosoft.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" <ho*******@SPAM MENOTgmail.coms chreef in bericht
news:%2******** ********@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
Mar 18 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1720
by: Carlos Ribeiro | last post by:
I'm looking for ways to load new class definitions at runtime (I'm not talking about object instances here, so a persistent object database isn't what I am looking for ). I'm aware of a few options, but I would like to discuss the possible side effects for a potentially big, long running application server. I am developing a business application based on workflow concepts. The model is quite simple: a business process is modelled as a...
3
2319
by: claus.hirth | last post by:
When I execute the following statment using the Command Center it works: LOAD CLIENT FROM 'Y:\\TheFixedWidthData.txt' OF ASC METHOD L ( 1 1,2 11,12 17) REPLACE INTO S00.TheTargetTable NONRECOVERABLE WITHOUT PROMPTING Yet when I try to execute the same statement in a PreparedStatement it does not work, but gives me a SQLException:
2
4161
by: EH Eisenberger | last post by:
It seems a bug in access. When you open any form in MS Access XP and move to another record from where the form started, and then close the Access application, the FormLoad event will be executed while closing. You can prove this if you'll place a call to MsgBox in FormLoad. Any response will be appreciated. Thanks
2
7330
by: Thomas Huber | last post by:
I´m working on an access aplication for a while now and at least 3 times changed wheather the load() of a form or of it´s subform ist executed first. I checked this fact in the debuging mode several times and i can´t see what changed witch load ist execuded first. don´t get me worng normaly always the same load ist executed first but this changes sometimes. maybe linked to the computer the .mdb ist executed from but i´m not to sure...
3
3620
by: feng | last post by:
We have a windows form project that has multiple child forms inherit from one base form. In our base form's form load event handler, we have some common logic in there. These common logic is needed by all the child forms when they load up. So when a child form gets called, the base's form load event handler gets called first, so is the common logic, then the child's load event handler gets executed. So far, everything works fine,...
1
2266
by: Jason Richmeier | last post by:
I am experiencing some unexpected behavior with the Form Load event in a Windows application. Hopefully, someone can explain why this behavior is occurring. In my application, I have a form that I would like to show multiple times throughout the life of the application. The startup code for this form can be quite lengthy so I am hiding and showning the form (versus unloading and loading it). If I show the form non-modally (using the...
4
3703
by: nemesis.saurabh | last post by:
hi, i am stuck up on this problem. In a load balanced scenario the post back is not happening i.e. when a control on the web form is clicked, the post back does not occur at the server and server code does not get executed and it times out depending on the IIS settings. For example, we have a simple web form with a button. When the button is clicked, the code in the button click event in the .cs should get executed. However this does...
2
2955
by: Franky | last post by:
Threre is a Form containing a usercontrol In the form's Load event it references a usercontrol property, say, zz The first showdialog(formx) causes 1 usercontrol_load event 2 form_load event which causes zz as expected the second showdialog(formx) causes 1 form_load event which causes zz as expected
9
18043
by: RvGrah | last post by:
I'm completely new to using background threading, though I have downloaded and run through several samples and understood how they worked. My question is: I have an app whose primary form will almost always lead to the user opening a certain child window that's fairly resource intensive to load. Is it possible to load this form in a backgroundworker and then use the Show method and hide method as necessary? Anyone know of
0
9812
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11212
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10446
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8004
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7154
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6032
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4655
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.