|
-
May 28th, 2002, 02:55 AM
#1
Thread Starter
Junior Member
problem
Hello, I am new in this forum...
I program in vb .net (very nice, but I prefer the old vb6 ), but for work I program in vb.net.
I have a mdi program, with 1 child (configuration). I wont to disable the menuitem(of the parent) from the child, but nothing... Is possible?.
Thanks at all...
Ps. sorry for my ugly english...
ps2. the code
-------------------------------------------
frmparent.mainmenu1.enabled=false - doesn't exist...
-------------------------------------------
dim parent as new frmparent()
parent.menuitem1.enabled=false
doesn't work
(the syntax is ok, but it not disable the menu )
-------------------------------------------
Thanks!
-
May 28th, 2002, 04:11 AM
#2
Hyperactive Member
It's not working because yopu are disabling the menuitem in a new instance of the parent - you need to use the actual parent.
When you open the child form, you probably use code like this...
VB Code:
Dim objForm As New frmChild()
With objForm
.MdiParent = Me
.Show()
End With
So you should use the .MdiParent property to set the menuitem.
In the Child form
VB Code:
Me.MdiParent.MenuItem1.Enabled = False
Hope this helps
-
May 28th, 2002, 06:07 AM
#3
Thread Starter
Junior Member
Thanks for the answare...
But...
I have tryied the code
Me.MdiParent.MenuItem1.Enabled = False
but the menuitem1 is not a valid option.....
only menu exist...
And this is the code to open the child:
Dim SelOper As New frmSelOp()
SelOper.MdiParent = Me
SelOper.Show()
-
May 28th, 2002, 07:13 AM
#4
Hyperactive Member
ok, you need to convert the MdiParent to the specific type of your parent form.
Try this in the child form
VB Code:
Dim oParent As frmParent
oParent = CType(Me.MdiParent, frmParent)
oParent.MenuItem1.Enabled = False
-
May 28th, 2002, 07:33 AM
#5
Thread Starter
Junior Member
wow!
it work fine!!!!
Very 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
|