We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to invoke child windows's control event just like click event ot button

Thread ID:

Created:

Updated:

Platform:

Replies:

3774 Apr 8,2003 02:46 AM Apr 9,2003 12:42 AM Windows Forms 2
loading
Tags: FAQ
pawan jain
Asked On April 8, 2003 02:46 AM

hi to all i have add one tool bar in my mdi menu ... which contains add delete query ..etc all buttons but on click any of them it should triger the cmdadd_click of active child windows. thanx pawan

Ramesh Praveen [Syncfusion]
Replied On April 8, 2003 02:59 PM

THis cannot be setup in the designer. You will have to listen to the Click in a event in the mdi main form in which you should get the ActiveMdiClient, cast it to your type and then call another method in that type. -Praveen

pawan jain
Replied On April 9, 2003 12:42 AM

> THis cannot be setup in the designer. You will have to listen to the Click in a event in the mdi main form in which you should get the ActiveMdiClient, cast it to your type and then call another method in that type. > > -Praveen thanx 4 ur answer ...... but .... when i used below codes --- Dim i As Integer Dim p As Button MsgBox(ActiveMdiChild.Controls.Count) For i = 0 To ActiveMdiChild.Controls.Count - 1 MsgBox(ActiveMdiChild.Controls(i).Name) If ActiveMdiChild.Controls(i).Name = "CmdAdd" Then p = ActiveForm.Controls(i) // Error ? p.PerformClick() Exit For End If Next i got error at the time of casting ... how can i remove this error ... error is ---> Specified cast is not valid .... error at [ p = ActiveForm.Controls(i) ]

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;