473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Parent / Child Interaction

Hi guys

I'm sure this is really simple, but passing commands
between forms is a whole new thing to me, what I want to
do is when I load my child form I would like a menu item
on the parent to be enabled so I tried...

--\
Dim objParentForm As New MDIParentForm

objParentform.menuitem46.enabled = True
--/
in the childs loads event, with no success
regards steve

Nov 20 '05 #1
11 1386
Steve, maybe I'm missing something but in your parent form code when you
create the child, why don't you enable the menu item there too. Eg.
Private Sub createChild()
Dim f As New Form
f.MdiParent = Me
f.Show()
MainMenu1.MenuItems.Item(whatever).Enabled = True
End Sub
Regards
Hexathioorthooxalate
"Steven Smith" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Hi guys

I'm sure this is really simple, but passing commands
between forms is a whole new thing to me, what I want to
do is when I load my child form I would like a menu item
on the parent to be enabled so I tried...

--\
Dim objParentForm As New MDIParentForm

objParentform.menuitem46.enabled = True
--/
in the childs loads event, with no success
regards steve


Nov 20 '05 #2
Steve, maybe I'm missing something but in your parent form code when you
create the child, why don't you enable the menu item there too. Eg.
Private Sub createChild()
Dim f As New Form
f.MdiParent = Me
f.Show()
MainMenu1.MenuItems.Item(whatever).Enabled = True
End Sub
Regards
Hexathioorthooxalate
"Steven Smith" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Hi guys

I'm sure this is really simple, but passing commands
between forms is a whole new thing to me, what I want to
do is when I load my child form I would like a menu item
on the parent to be enabled so I tried...

--\
Dim objParentForm As New MDIParentForm

objParentform.menuitem46.enabled = True
--/
in the childs loads event, with no success
regards steve


Nov 20 '05 #3
Ok that seems like a sound idea but how do I get access
to a list of indexes with their associated menu item names
Nov 20 '05 #4
Ok that seems like a sound idea but how do I get access
to a list of indexes with their associated menu item names
Nov 20 '05 #5
"Steven Smith" <an*******@discussions.microsoft.com> schrieb

I'm sure this is really simple, but passing commands
between forms is a whole new thing to me, what I want to
do is when I load my child form I would like a menu item
on the parent to be enabled so I tried...

--\
Dim objParentForm As New MDIParentForm

objParentform.menuitem46.enabled = True
--/
in the childs loads event, with no success


I'd enable the item in the parent form when you load the child to avoid
accessing the parent from the child.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6
"Steven Smith" <an*******@discussions.microsoft.com> schrieb

I'm sure this is really simple, but passing commands
between forms is a whole new thing to me, what I want to
do is when I load my child form I would like a menu item
on the parent to be enabled so I tried...

--\
Dim objParentForm As New MDIParentForm

objParentform.menuitem46.enabled = True
--/
in the childs loads event, with no success


I'd enable the item in the parent form when you load the child to avoid
accessing the parent from the child.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #7
sorry that was a silly question since menu's are arranged
in a heirarichal structure the indexes are obviously
built in the same fashion, so there's no need for me to
access the collection, thanks for your help
Nov 20 '05 #8
sorry that was a silly question since menu's are arranged
in a heirarichal structure the indexes are obviously
built in the same fashion, so there's no need for me to
access the collection, thanks for your help
Nov 20 '05 #9
If this is the same Stephen Smith that was posting a few months ago and
working from a step by step book, you seem to have come a long way. If its
you, keep up the good work.

OHM

Steven Smith wrote:
Hi guys

I'm sure this is really simple, but passing commands
between forms is a whole new thing to me, what I want to
do is when I load my child form I would like a menu item
on the parent to be enabled so I tried...

--\
Dim objParentForm As New MDIParentForm

objParentform.menuitem46.enabled = True
--/
in the childs loads event, with no success
regards steve

Nov 20 '05 #10
Yip still the same me...

the force grows stronger inside me with every day that
passes, thanks for all your help at the beggining of my
journey.

regards steve
Nov 20 '05 #11
* "Steven Smith" <an*******@discussions.microsoft.com> scripsit:
I'm sure this is really simple, but passing commands
between forms is a whole new thing to me, what I want to
do is when I load my child form I would like a menu item
on the parent to be enabled so I tried...

--\
Dim objParentForm As New MDIParentForm

objParentform.menuitem46.enabled = True
--/


\\\
DirectCast(Me.MdiParent, MDIParentForm).MenuItem46.Enabled = True
///

Make sure, the menuitems 'Modifier' property is set to 'Friend' or
'Public'.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ahaideb | last post by:
I have a table (relation) in my database: --------------- | parent | child | --------------- | 1 | 2 | | 1 | 3 | | 2 | 4 | | 2 | 5 ...
6
by: jalkadir | last post by:
Let's say that I have this class: class Parent{ private: char* str; public: const char* getStr(){return str;} }; And then I create a child class class Child{ private: std::string str;...
1
by: Tomas Vera | last post by:
Hello All, I'm working on a web app that will simulate a Windows app. One of the items that I've trouble reproducing is the parent/child interaction that might occur between a windo and popup...
4
by: Danny Tuppeny | last post by:
Hi all, I've been trying to write some classes, so when I have a parent-child relationship, such as with Folders in my application, I don't have to remember to add a parent reference, as well as...
0
by: Steven Smith | last post by:
Hi guys I'm sure this is really simple, but passing commands between forms is a whole new thing to me, what I want to do is when I load my child form I would like a menu item on the parent to...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
7
by: msxkim | last post by:
How to execute functions in the parent class first and then functions in the child class? For example, I have a parent class with functions 'ONE' and 'TWO' and child class has a function 'THREE'. ...
7
by: Paul | last post by:
Hello, I'm coming from a PHP background and am working on a large-scale VB.NET project. One of the cornerstones of this project is a reusable form class, to standardize our web forms. My goal...
4
by: jewel87 | last post by:
Hi everyone! I'm writing some code in C under UNIX, which should give some output like this: PARENT: pid = 10063 CHILD: my pid = 10064 CHILD: my parent's pid = 10063 CHILD: Sleeping... PARENT:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.