|
-
Feb 28th, 2005, 02:00 AM
#1
Thread Starter
Frenzied Member
Access MDI parent control from MDI child[RESOLVED]
Hello everybody,
From my MDI child form, I need to change the text property of statusbar panel of MDI parent.
Thanks
Last edited by usamaalam; Mar 1st, 2005 at 12:48 AM.
Reason: RESOLVED
-
Feb 28th, 2005, 05:05 PM
#2
Re: Access MDI parent control from MDI child
 Originally Posted by usamaalam
Hello everybody,
From my MDI child form, I need to change the text property of statusbar panel of MDI parent.
Thanks
from the MDI child use this
this.MdiParent.YouStatusBarsName....
rate my posts
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Feb 28th, 2005, 11:26 PM
#3
Thread Starter
Frenzied Member
Re: Access MDI parent control from MDI child
I am unable to see status bar in MDIParent property of the child form.
-
Mar 1st, 2005, 12:10 AM
#4
Re: Access MDI parent control from MDI child
 Originally Posted by usamaalam
I am unable to see status bar in MDIParent property of the child form.
oh my bad! I wasnt thinking right
VB Code:
Dim frmParent As frmMdiParent
frmParent = DirectCast(Me.MdiParent, frmMdiParent)
frmParent.statusBarHere
MdiParent property returns the form, but it returns it as a general form. You need to convert it to the the type of your main mdi form is called, and you do that by calling DirectCast as you see up there
rate my posts
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Mar 1st, 2005, 12:19 AM
#5
Re: Access MDI parent control from MDI child
ah thought I'm in the vb.net forum. I leave that up for reference here's the c# version:
Code:
frmMdiParent frmParent = (frmMdiParent)this.MdiParent;
frmParent.statusBar1.Text="DASFADSF";
where frmMdiParent is the name of your mdi form, and you put this code in the mdi child form.
One thing I just noted is that apparently in C# controls and things you put on the form are declared as private, so you need to manually change the code that VS.NET generates. In your mdi form, if you search for the name of your statusbar you should see a line like this near the top of the class:
private System.Windows.Forms.StatusBar statusBar1;
you need to change the private to public in order for you to be able to access it through the mdi child
HTH
rate my posts
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Mar 1st, 2005, 12:44 AM
#6
Thread Starter
Frenzied Member
Re: Access MDI parent control from MDI child
Thanks. I made a little conversions for C#. Now this works for me.
-
Dec 9th, 2011, 10:14 AM
#7
New Member
Re: Access MDI parent control from MDI child[RESOLVED]
Thank you so much, i searched too much for this but not one was able to help me, by chance i visited ur reply and got the solution.....
Good work done...
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|