We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,831 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Mdi Child form activate event does not fire

Dear Friends,

There are 2 form (form1,form2) and 2 dialogbox (dialogbox1,diologbox2) in my application.
When application start at that time form 1 loaded, on form 1 when button-1 click, form2(as mdi parent) and dialogbox-1 (with textbox-1 and button-1 as mdichild) show. when button-1 on dialogbox-1 click dialog-2 (with textbox-1) show.

On close event of dialogbox-2 or activate event of dialogbox-1 the data on textbox-1 of dialog-2 will send to textbox-1 of dialogbox-1 but this event does not fired.

2
Contributors
7
Replies
2 Days
Discussion Span
5 Months Ago
Last Updated
9
Views
vasim jada
Light Poster
30 posts since Jul 2011
Reputation Points: 8
Solved Threads: 0
Skill Endorsements: 0

You'll have to show us what code you're using.

tinstaafl
Nearly a Posting Virtuoso
1,304 posts since Jun 2010
Reputation Points: 341
Solved Threads: 225
Skill Endorsements: 14
Code for button on Form1

Form2.show
dim Child_dialog as new dialog1
Child_dialog.MdiParent = Form2
Child_dialog.show 


Code for button on Dialogbox1 in button click event
Dialog2.show

code for button on dialogbox2 in button click event

dialogbox1.textbox1.text=dialogbox2.textbox1.text
vasim jada
Light Poster
30 posts since Jul 2011
Reputation Points: 8
Solved Threads: 0
Skill Endorsements: 0

in the button click event for dialog2 are you putting the code to move the text after the me.close() statement? If the form is closed the controls in it can't be read. Also there are 2 buttons on a standard dialog. Make sure you're using the click event for the proper button.

tinstaafl
Nearly a Posting Virtuoso
1,304 posts since Jun 2010
Reputation Points: 341
Solved Threads: 225
Skill Endorsements: 14

Hi Dear,

My actual problem is that when focus come to dialogbox-1 as dialogbox-2 close event, I want active event of dialogbox-1 to be fired.
But I can not and one more thing is that before Making mdiparent and child it was fire means (active event of dialogbox-1).

vasim jada
Light Poster
30 posts since Jul 2011
Reputation Points: 8
Solved Threads: 0
Skill Endorsements: 0

put dialog1.show in the button click for dialog2, that will activate it. also in the code you submitted you appear to have 5 different dialogs, child_dialog, dialog1, dialog2, dialogbox1, dialogbox2. this can make it difficult to decipher your meaning. I gather though that the activate event isn't firing on dialog1. Where is the code for dialog1 active event?

tinstaafl
Nearly a Posting Virtuoso
1,304 posts since Jun 2010
Reputation Points: 341
Solved Threads: 225
Skill Endorsements: 14

**

 Bold Text Here

            Dim newchild As New Dia_Job_assignment
            newchild.MdiParent = Frm_BackGround
            newchild.TextBox1.Text = user_Employee_id
            newchild.TextBox2.Text = user_user_id
            newchild.Activate()

**

vasim jada
Light Poster
30 posts since Jul 2011
Reputation Points: 8
Solved Threads: 0
Skill Endorsements: 0

That's the code to activate the form. In the form's code declarations is an activate event subroutine, that is triggered when the form is activated. This is called the activate event. If you need something to happen when the form activates this is the subroutine that contains the code that runs when the form is activated(i.e. adding text to a textbox).

tinstaafl
Nearly a Posting Virtuoso
1,304 posts since Jun 2010
Reputation Points: 341
Solved Threads: 225
Skill Endorsements: 14

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.2303 seconds using 2.64MB