473,388 Members | 1,198 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,388 software developers and data experts.

Activate mdiChildren sub from mdiParent

Hi to all,
Im a new user of this group. I have a mdiParent form with a toolbar
that contains some buttons. One of this button have to activate the
function "click" of a button located into the mdi child form. How can i
do?
Thanks to all,
Kamme

Jan 13 '06 #1
2 2382


"ca*************@eurotel.it" wrote:
Hi to all,
Im a new user of this group. I have a mdiParent form with a toolbar
that contains some buttons. One of this button have to activate the
function "click" of a button located into the mdi child form. How can i
do?
Thanks to all,
Kamme

Jan 13 '06 #2
Sorry, hit post accidentally...

Kamme -

By nature, your "click" events are private to the form you are working with,
so they can't be "seen" by outside classes or modules. While you could just
change the scope of the method for the event to Public and then call to
ChildFormName.Button1_Click, I don't personally like that method. As you
didn't state which version of VB you are using, I'll write this for the
lowest common programming denominator:

The steps to make this work are:

1) Create a Public Sub to handle your button click on the child form.
2) Move your code from the button's _Click event to the Public Sub in
step 1.
3) Call the Public Sub from step 1 in your button's _Click event.
4) Call the Public Sub in step 1 from the MDI Parent.

In your child form button _Click event, take all the code out and place it
into a Public Sub as such:

Public Sub HandleButtonClick()
'Put your button click code here
End Sub

In your button's _Click event, call the "HandleButtonClick" code:

Private Sub Button1_Click()
HandleButtonClick
End Sub

In your MDI Parent, call the "HandleButtonClick" code by referencing your
child form:

ChildFormName.HandleButtonClick

This should work for you. The parameters for your event may be different
depending on what language your using, such as:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

I hope this helps!

- Jay

Jan 13 '06 #3

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

Similar topics

4
by: rat | last post by:
i am having 3 panels(0,1 & 2) in a Statusbar. Using MDI form, i can access and set the text for the panels(0 and 2).. But how can i access the panel(1) from MDI Child form. like...
4
by: DraguVaso | last post by:
Hi, I have a Form which has the property IsMdiContainer = True. So it contains a whole bunch of MdiChilds. Those MdiChilds are all instances of two forms I have: I have some that are an instance...
26
by: Paul Mars | last post by:
FormParent load opens FormChildA. FormChildA btn click opens FormChildB. (FormChildA and FormChildB are both children of FormParent) (FormChildA and FormChildB are different forms) Problem:...
4
by: Ben dotNet | last post by:
FormA is the mdiParent FormB is the child FormC is the Form that is used to open FormB How do I open FormB from FormC (that is not a child) so that it it's mdiParent is FormA? Thanks, --Ben
5
by: juststarter | last post by:
hi there here is my problem : there is a main form (frmMain) which calls a searchForm (frmSearch). Then i select an item (from the returned ones) and open a third form (frmData). Taking from...
1
by: Roy | last post by:
Hi all, I'm opening a mdichild (Form2) within another mdichild (Form1). In Form1 I have: Form2.MdiParent = Me.MdiParent 'No problem here .... .... If Form2.ShowDialog = DialogResult.OK Then 'I...
0
by: Supra | last post by:
i got code working. similar to mirc chat. but what happen when i joined the channel #visualbasic...that fine with me , i got all data coming into first mdichild. but when i joined another channel...
1
by: PDP-8E | last post by:
I'm new to VB.Net 2003 - (2 weeks in) so this MAY be straightforward... (Things changed since Octal Assembler I see !!!) I'll try to lay this out in a way that makes sense I created a...
2
by: carmelo.orlando | last post by:
Hi to all, Im a new user of this group. I have a mdiParent form with a toolbar that contains some buttons. One of this button have to activate the function "click" of a button located into the mdi...
7
by: Andrus | last post by:
I have UserControls in MDI child forms containing TextBoxes and other controls. When user re-activates form, I need that Control which was last activated is activated again. Currently *first*...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.