473,249 Members | 1,876 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,249 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 2102
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: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
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...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...

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.