473,399 Members | 4,254 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,399 software developers and data experts.

Fire Button click event from another form in 2005

I have a form FormA with a button Button1; I use SetParent(FormB.Handle,
this.Handle) to load FormB inside FormA. FormB also has a button Button1
which displays a messagebox.
When Button1 is clicked on FormA; i would like the Button2 click event on
FormB to be fired up and display the messagebox.
How do I do it? will appreciate some sample code.
Aug 1 '08 #1
5 2105
Never mind, i've got the answer.

"Rick" wrote:
I have a form FormA with a button Button1; I use SetParent(FormB.Handle,
this.Handle) to load FormB inside FormA. FormB also has a button Button1
which displays a messagebox.
When Button1 is clicked on FormA; i would like the Button2 click event on
FormB to be fired up and display the messagebox.
How do I do it? will appreciate some sample code.
Aug 1 '08 #2
On Fri, 01 Aug 2008 08:06:01 -0700, Rick <Ri**@discussions.microsoft.com>
wrote:
Never mind, i've got the answer.
It is customary and polite, when you have found the answer to your own
question, to post that answer to the newsgroup where you asked the
original question. That way, if someone else has the same question later,
they can find the answer to it, instead of just the question.

Pete
Aug 1 '08 #3
How did you do it, Rick?

"Rick" wrote:
Never mind, i've got the answer.

"Rick" wrote:
I have a form FormA with a button Button1; I use SetParent(FormB.Handle,
this.Handle) to load FormB inside FormA. FormB also has a button Button1
which displays a messagebox.
When Button1 is clicked on FormA; i would like the Button2 click event on
FormB to be fired up and display the messagebox.
How do I do it? will appreciate some sample code.
Aug 1 '08 #4
FormB frm = new FormB();
SetParent(frm.Handle, this.Handle);

Button btn = frm.btnFire;
this.InvokeOnClick(btn, EventArgs.Empty);
"jp2msft" wrote:
How did you do it, Rick?

"Rick" wrote:
Never mind, i've got the answer.

"Rick" wrote:
I have a form FormA with a button Button1; I use SetParent(FormB.Handle,
this.Handle) to load FormB inside FormA. FormB also has a button Button1
which displays a messagebox.
When Button1 is clicked on FormA; i would like the Button2 click event on
FormB to be fired up and display the messagebox.
How do I do it? will appreciate some sample code.
Aug 6 '08 #5
I completely agree with you; will do next time.

"Peter Duniho" wrote:
On Fri, 01 Aug 2008 08:06:01 -0700, Rick <Ri**@discussions.microsoft.com>
wrote:
Never mind, i've got the answer.

It is customary and polite, when you have found the answer to your own
question, to post that answer to the newsgroup where you asked the
original question. That way, if someone else has the same question later,
they can find the answer to it, instead of just the question.

Pete
Aug 6 '08 #6

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

Similar topics

6
by: Mark | last post by:
I have been working for quite some time on this issue which in theory should be quite simple. The problem is that the Cancel and Save events are not fired when their respective buttons are...
5
by: Carlo Marchesoni | last post by:
From an aspx page (A.aspx) I open another one (B.aspx - for table lookup). When the user selects an entry in B.aspx I would like to force a button's event in A.aspx to be fired. I guess the only...
2
by: Sam Miller | last post by:
Hi, I have a button event that won't fire. I left it on Friday and it worked fine. I came back in on Monday and it won't fire. I tried putting another button and just putting a...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
5
by: Verde | last post by:
This is admittedly an apparently odd request... but please indulge me if you don't mind: Suppose I have two <asp:Button.../> on a page (Button1 and Button2). User clicks Button1 and triggers a...
2
by: eveready | last post by:
Hello I have two forms - a start form running in the background and a content form in the foreground. When a timer fires on the start form, I need to fire the click event for a button on the...
4
by: sowencheung | last post by:
Hi, all The scenario is like this: I have a master page, contains two user controls, one is a search control, another is a login control. The server-side <form> is in the master page,...
4
by: Ty Salistean | last post by:
So, here is a wierd question that we have been discussing for a bit now. Does an event fire even though nothing is subscribed to listen to the event? For instance, does the Click event of a...
19
by: Daniela Roman | last post by:
Hello, I try to fire an event under a button click event and maybe anybody can give a clue please. I have let's say a WEB grid with PageIndexChanged event: private void...
2
by: Joergen Bech | last post by:
Hope someone has a solution or some suggestions for this. This cannot be right?!? Problem: I have multiple non-modal forms open at the same time. One or more of these forms have a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...
0
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...

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.