473,398 Members | 2,343 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,398 software developers and data experts.

Manipulating Menus from a module / form2

Hi, I have a MDIForm with a menu name mnuVideo that opens a childForm.

My question is a newbie question, I was wondering how can I manipulate
the mnuVideo that is in the MDIForm from the childForm? Like "enabled"
& "checked" properties.

Lastly I need to do the same manipulation of the mnuVideo from a
Module.

Code samples would be very much appreciated.

Here's what I did.

MDIForm's mnuVideo code
************************************************** ******************
Private Sub mnuVideo_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles mnuVideo.Click
Dim frmVideoPreviewInstance As New frmVideoPreview
frmVideoPreviewInstance.MdiParent = Me
frmVideoPreviewInstance.Show()
End Sub
************************************************** ******************
Load Event of ChildForm w/c doesnt work!
************************************************** ******************
Private Sub frmVideoPreview_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load

Dim mdiVideoInspectionInstance As New mdiVideoInspection

mdiVideoInspectionInstance.itmVideoStream.Enabled = True
mdiVideoInspectionInstance.itmVideoStream.Checked = True
mdiVideoInspectionInstance.itmVideoActualSize.Enab led =
True
mdiVideoInspectionInstance.itmVideoActualSize.Chec ked =
False
End Sub
************************************************** ******************

I did not attempt to make the code in the Modules I have because I
can't even get the ChildForm to change the MDIForm's menu. :(
Sample codes for ChildForm & Module to manipulate MDIForm's menu will
really be very much appreciated!!!

Thanks,
Henry
Nov 20 '05 #1
3 1194
did u check property window IsMidContainer to true?
regards,

Henry Wu wrote:
Hi, I have a MDIForm with a menu name mnuVideo that opens a childForm.

My question is a newbie question, I was wondering how can I manipulate
the mnuVideo that is in the MDIForm from the childForm? Like "enabled"
& "checked" properties.

Lastly I need to do the same manipulation of the mnuVideo from a
Module.

Code samples would be very much appreciated.

Here's what I did.

MDIForm's mnuVideo code
************************************************** ******************
Private Sub mnuVideo_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles mnuVideo.Click
Dim frmVideoPreviewInstance As New frmVideoPreview
frmVideoPreviewInstance.MdiParent = Me
frmVideoPreviewInstance.Show()
End Sub
************************************************** ******************
Load Event of ChildForm w/c doesnt work!
************************************************** ******************
Private Sub frmVideoPreview_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load

Dim mdiVideoInspectionInstance As New mdiVideoInspection

mdiVideoInspectionInstance.itmVideoStream.Enabled = True
mdiVideoInspectionInstance.itmVideoStream.Checked = True
mdiVideoInspectionInstance.itmVideoActualSize.Enab led =
True
mdiVideoInspectionInstance.itmVideoActualSize.Chec ked =
False
End Sub
************************************************** ******************

I did not attempt to make the code in the Modules I have because I
can't even get the ChildForm to change the MDIForm's menu. :(
Sample codes for ChildForm & Module to manipulate MDIForm's menu will
really be very much appreciated!!!

Thanks,
Henry


Nov 20 '05 #2
"Henry Wu" <he***********@hotmail.com> schrieb
Hi, I have a MDIForm with a menu name mnuVideo that opens a
childForm.

My question is a newbie question, I was wondering how can I
manipulate the mnuVideo that is in the MDIForm from the childForm?
Like "enabled" & "checked" properties.

I personally wouldn't make this approach. Instead, I would raise an event
within the child and have the MDI parent handle the event and reflect the
changes and states of the child form, in this case by setting the menu
properties. This way you don't have to access the parent at all, and
consequently the MDI child might be used together with other parent forms
(maybe in future).
Lastly I need to do the same manipulation of the mnuVideo from a
Module.


Why don't you put the code in the MDI parent?
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
Hi, I was able to figure it out by placing a global public variable at
a seperate module for example videoGlobal as Form1 then placing
videoGlobal = Me at Form1's code before "InitializeComponent()" . It
works now, I'm not sure if what I did was "messy" or unprofessional,
but it would be great if I could learn form some sample codes how to
do it more professionally.

Thanks again for your time!!!
Henry

"Armin Zingler" <az*******@freenet.de> wrote in message news:<40*********************@news.freenet.de>...
"Henry Wu" <he***********@hotmail.com> schrieb
Hi, I have a MDIForm with a menu name mnuVideo that opens a
childForm.

My question is a newbie question, I was wondering how can I
manipulate the mnuVideo that is in the MDIForm from the childForm?
Like "enabled" & "checked" properties.

I personally wouldn't make this approach. Instead, I would raise an event
within the child and have the MDI parent handle the event and reflect the
changes and states of the child form, in this case by setting the menu
properties. This way you don't have to access the parent at all, and
consequently the MDI child might be used together with other parent forms
(maybe in future).
Lastly I need to do the same manipulation of the mnuVideo from a
Module.


Why don't you put the code in the MDI parent?

Nov 20 '05 #4

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

Similar topics

6
by: Bob | last post by:
Declaring a module level form object in multiple froms within a project to show another project form causes a stack overflow and other assorted errors. Can anyone help?
3
by: cefrancke | last post by:
The only reason I ask is that no one has made this subject clear or given a definitive answer. What I would like to do is, after turning off all the menus/tbars/etc using the startup options. ...
2
by: blah | last post by:
if i have an mdi parent with a menu option of View->source and this menu item creates a new child window how do i make a checkmark appear when the child form is loaded and have the checkmark...
8
by: kyle | last post by:
Hi ther I have a small vb.net 2003 program with 5 forms: form1, form2, et I have a module in the program from where I want to launch form1 - the main for In the module I have a bunch of public...
4
by: http://www.visual-basic-data-mining.net/forum | last post by:
Hi Does anyone know how to stay connected to the server and at the same time i can pass the string to and from the module to the form..... What I want: I put the connection at the...
2
by: Bert Szoghy | last post by:
Hello, I am missing something about Visual Basic .NET module variables and window close events. In the following code, after opening Form2 by clicking a button on Form1 and then closing...
8
by: tonFrere | last post by:
Hello all, I did a lot of research on the subject and came to the conclusion that what I want to do might not be "good practice". I created a set of table to manage user rights to forms in my...
1
by: c2015 | last post by:
I need help with some VB code. I will keep it generic and clear as possible. I have two forms lets call Form1 and Form2 I have a class module (CM) and a sub class module (SCM) instantiated in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.