473,327 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Form Activated event in c#.net

hello friends, i'm new to c#.net.i want to display a message box, when a form is activated. i wrote code like this.

private void Form1_Activated(object sender,System.EventArgs e)
{
MessageBox.Show("Hello");
}

but this code is not working. what is the solution for this.
Jan 28 '08 #1
8 10325
leoiser
41
put the messagebox in Form_load

Thanks
Jan 28 '08 #2
It works on my computer...not just works, it keeps working!
I can't close the messagebox now. It will open again when I push the button "OK".
Jan 28 '08 #3
r035198x
13,262 8TB
It works on my computer...not just works, it keeps working!
I can't close the messagebox now. It will open again when I push the button "OK".
Which method have you used now? Form_load?
Jan 28 '08 #4
Activated
just like noorcsharp
Jan 28 '08 #5
r035198x
13,262 8TB
Activated
just like noorcsharp
Perhaps Form_load is where you want it then ...
Jan 28 '08 #6
I kown!
When Form1 is activated, the massagebox pops up. Now the activated form is the massagebox, but if I close it, Form1 activate again.
so...massagebox pops up again... and again...
Jan 28 '08 #7
r035198x
13,262 8TB
I kown!
When Form1 is activated, the massagebox pops up. Now the activated form is the massagebox, but if I close it, Form1 activate again.
so...massagebox pops up again... and again...
Yep, that would be the behaviour with Form_activated ...
Jan 28 '08 #8
Plater
7,872 Expert 4TB
Form_Activated happens when the form gains focus. (I think, maybe I am confusing with Form_Enter )
Form_Load happens when the form first loads
Jan 28 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: LarryR | last post by:
I am trying to get a small form (using ShowDialog) to display over my main for as soon as the main for is displayed. I can't seem to find an accesible property or event that I can use to tell when...
4
by: Randy | last post by:
Hello all, I have a form with a text field (textBox1) on it. Apparently, textBox1.Focus() doesn't work when the form is initializing. I put this in the Constructor and also in the Load event for...
1
by: Kevin Carter | last post by:
Hi there...hoping somebody can help me out because I am almost ready to pull out my hair. My problem is as follows: In a method in my main form (non MDI app), I instantiate and .Show another...
10
by: Phil | last post by:
Hello Can anybody tell me which events are fired immediately after a form is displayed i.e. appears on screen? Ta Phil
4
by: Grant Schenck | last post by:
I have a C# form application. Once my main window is showing I want to pop-up a login type dialog. What event would I trap to affect this? I tried handling the form load but the main form window...
3
by: Cc | last post by:
does event onload mean form already loaded or before loaded? I make a form and I inherit that form on another form, when I run, it execute the process on the parent form without showing the form on...
10
by: B-Dog | last post by:
I want to run something once my form in completely loaded and drawn but running at the end of form load doesn't do I guess cause of the large dataset fill and the form isn't fully loaded. Where...
3
by: Dennis | last post by:
I have the following code for showing a form: dim frm as new myForm frm.ShowDialog (The Form Load Event is fired then I hide the form using Me.Hide when the X in the UR corner is clicked). ...
2
by: thomasp | last post by:
Using VB 2005 Beta. I have a form containing a DataGirdView. The cell enter, cell validating, row enter, row validating events have a good bit of code that gets excuted for each of these...
3
by: Dennis | last post by:
I thought that the Load Event fired first and the Activated event fired next when a control is shown. For example Dim myForm as New Form1 myForm.Show I put a breakpoint in the load event...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.