C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » VB.NET Syntax »

Accessing MDIParent Methods from MDI Child Form


Posted Date: 03 Sep 2009    Resource Type: Code Snippets    Category: VB.NET Syntax
Author: Hefin DsouzaMember Level: Diamond    
Rating: 1 out of 5Points: 15



The Code below will demonstrate the procedure of calling an MDIParent Method from an MDIChild Form.

It may come handy in many cases where you have an MDIParent Form which has some menus disabled then from an Login Form which is an MDI Child form you need to Enable the Menus.

Solution :
The MDI Parent Form :
A) Making the Methods Public

Public Sub Enable()
SpecialToolStripMenuItem.Enabled = True
End Sub

B) Calling the Method from an MDI Child.This code will be written in the child form where you want the parent form method to be called.

Dim f As Form1 = Me.MdiParent
f.Enable()
Me.Close()

In this case the Form1 is the MDIParent Form.In the code the instance of Form1 f is Initialised with the Me.MdiParent which will get the reference of the MDI Parent Form.

Regards
Hefin Dsouza



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
MDIParent  .  MDIChild  .  Enable Menus  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Vb.Net control horizontal scorll bar
Previous Resource: Yes/No Confirmation Box
Return to Discussion Resource Index
Post New Resource
Category: VB.NET Syntax


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use