Forgot your password?
Sign in with
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Python questions
View Visual Basic questions
All Message Boards...
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Design and Architecture
Internet of Things
C / C++ / MFC
ATL / WTL / STL
Objective-C and Swift
Hardware & Devices
Hosting and Servers
.NET (Core and Framework)
Site Bugs / Suggestions
Spam and Abuse Watch
The Insider Newsletter
The Daily Build Newsletter
Most Valuable Professionals
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
What is 'CodeProject'?
Ask a Question
Bugs and Suggestions
Article Help Forum
Comments by Tony Hill (Top 19 by date)
If you want help with this it would be helpful to post your code here so we can examine it to find your problem.
Remember we cannot see your screen or read your mind, help us to help you by showing the code.
Form2 has two public events called 'form2Opened' and 'form2Closed', other forms can ask
to be notified when these events are raised.
I will only discuss the 'form2Opened' to not complicate matters.
In the Form1 Load event handler method Form1 registers an interest in being notified when
either of these events are raised and the method which should be called when the event is raised.
In the Form1 'Form1_Load' method we create Form2 and register an interest in the 'form2Opened' event and display the Form2.
private void Form1_Load(object sender, EventArgs e)
form2 = new Form2();
form2.form2Opened += Form2HasOpened; // (1)
After the call to ShowDialog() in the Form1 'Form1_Load' method the 'Form2_Load' method
executes, the first thing that happens is Form2 checks to see if anything is listening
to the Form2 form2Opened event by testing to see if it is null or not, if it is not null
the form2Opened event is invoked to notify Form1 that Form2 has loaded.
private void Form2_Load(object sender, EventArgs e)
if (form2Opened != null)
form2Opened.Invoke(this, new EventArgs()); // This will notify Form1 that Form2 has opened and that Form1
// should execute the Form1.Form2HasOpened method.
Control will now be passed to the Form1.Form2HasOpened method (see (1) above) and the code in the
method is executed which in the example will tell Form1 to hide itself with Hide() method,
private void Form2HasOpened(object sender, EventArgs e)
After the Form1.Form2HasOpened method has finished executing control is returned
to Form2.Form2_Load method where the event was invoked.
Much the same sort of thing happens with 'form2Closed' event but you should be able
work it out yourself.
Richard, Did you see the sneaky spam link under the Korean text.
Can you see the sneaky spam link under the Korean text.
As Richard said this question was answered nine years and your solution is vulnerable to SQL injection attacks.
It should be placed on its own line after the last line of your code.
I have modified the code in my example, next time you ask a question try and make the intent more clear so others can understand your problem.
Only 7 years late with an answer which does not answer the OP's question, the OP actually wants to focus (highlight) a newly created node in the treeview not focus a control.
Well spotted Patrice T, I knew the maths was wrong but did not spot the lack of a return.
Do you really think it a good idea to show how to create sql injection vulnerabilities in sql statements
Seems you have done it again
This is just a copy of the first sentence of solution 1.
Completely unrelated nonsense to the original posters question.
Unlikely that the original poster is still interested as the question is 5 years old.
This problem was solved by the original poster 9 years.
Apart from answering a 10 year old question you did not answer the OP's question about how to do it in SQL not c#
Yes but your CupMethod calls the BrewMethod with one argument as doesCupMethod, WaterMethod, SizeMethod, LidMethod.
You have to fix it in all those methods as well.
This is Android Java not C++.
Last Updated 1 Jan 1900
All Rights Reserved.