473,520 Members | 7,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trigger On Click Event of a button from another form.

Hi
I would like to be able to trigger the "on click event" of a button
from the code within a different form. Does anyone know if this is
possible and if so how.

TIA
Andrew
Feb 6 '08 #1
2 27260
On Wed, 6 Feb 2008 10:42:59 -0800 (PST), An****@2bsystems.co.uk wrote:
Hi
I would like to be able to trigger the "on click event" of a button
from the code within a different form. Does anyone know if this is
possible and if so how.

TIA

Andrew
First make sure the sub procedure is set to Public (not Private).

To call it from another form:
Call Forms("NameOfForm").CommandName_Click

Both forms must be open.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Feb 6 '08 #2
On 6 Feb, 21:19, fredg <fgutk...@example.invalidwrote:
On Wed, 6 Feb 2008 10:42:59 -0800 (PST), And...@2bsystems.co.uk wrote:
Hi
I would like to be able totriggerthe "onclickevent" of a button
from the code within a different form. Does anyone know if this is
possible and if so how.
TIA
Andrew

First make sure the sub procedure is set to Public (not Private).

To call it from another form:
Call Forms("NameOfForm").CommandName_Click

Both forms must be open.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Hi Fred
Thanks you for that, it works on 2 separate forms, however one of my
forms requires me to trigger it on a sub form, I have tried the
obvious which fails:

forms!frm1!frm1_Sub.event

TIA
Andrew
do you know how to
Feb 7 '08 #3

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

Similar topics

3
693
by: Cary Linkfield | last post by:
I have a standard form I use. It inherits from Windows.Forms.Form. I usually add a Cancel button the form in the designer. I want to raise the Cancel button's Click event when the user presses the escape key. Public Class myStandardForm Inherits Windows.Forms.Form Private WithEvents _btnCancel As Button Private Sub _Load(ByVal sender...
1
10162
by: sachin | last post by:
How to check Maximize button click event of a Form or how to check whether present size of form is maximum available size
2
4581
by: ital1 | last post by:
Hi I have created one form that has an event handler, coded in the following lines : (ON FORM1 : Picture Boxes, when clicked they fire events) this.OnPADClick += new FrmPAD.OnPADClickEventHandler (this.FrmPAD_OnPADClick);
2
6462
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 other form. I have delcalered the 2nd form as a friend, but still cannot get to the button's click event Any help would be very appreciated thnx
6
2002
by: romy | last post by:
Hi I have two .NET applications that run together on the same local PC. I have a situation, that when I click a button on the first application, I need to trigger an event for the second Application. What is the simplest way to implement that ?
1
1762
by: bradw2k | last post by:
I have one frame that needs to cause a button click event on another frame. I was trying to do this by putting a display:none LinkButton on the target frame, and having a javascript on that page that can be called by the remote frame, and the javascript would say btn.click() ... but that doesn't cause the form to submit. How can I accomplish...
2
2369
by: Chu | last post by:
Thanks everyone for taking a moment to read this. I've got a page where I use a LinkButton and I wire up a dynamic event to the button. When the user clicks the button, the event is fired as expected. In the event code for that button, a new LinkButton is added to the page and is wired up to yet a different event, however when clicked, the...
4
1829
by: LyzH | last post by:
Someone else had a question on how to emulate a mouse click. I tried posting in that thread but I have something of a twist on this problem and I'm really in trouble here! If I don't get help soon, I'm going to fail this class and the class is already dragging down my GPA. I'm taking an introductory visual basic class with an advanced...
8
36073
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query button on it. If the query returns multiple results, a new window is opened with a grid containing the results. When the user double clicks on the...
5
2111
by: =?Utf-8?B?Umljaw==?= | last post by:
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...
0
7230
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...
0
7458
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. ...
0
7623
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7585
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...
0
5763
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...
1
5152
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...
0
4804
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...
0
1672
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
1
851
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.