473,387 Members | 1,420 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,387 software developers and data experts.

Enumerating MDIList Menu Item at Run-Time

I have an MDIList menu item that I want to enumerate at run-time and
possibly change the text shown for some of the MDI children included in
that list. When I enumerate the collection for that menu item, none of
the open MDI child windows show in the list although they are clearly
there in the actual drop-down of the menu item. Does anyone know how I
can enumerate the menu item that contains the MDIList at run-time and
change the text associated with some of the MDI children in that list?

Thank you.

Apr 19 '06 #1
4 2256
VJ
The best way to do this is , enumrate the MDI children open, and then change
the text.. something like below... ( I am assuming you are doing the code in
your MDI form)

Dim frmChild as Form

For Each frmChild In Me.MdiChildren

If typeof frm Is Form1 then
frm.Text = "My New Text"
else if typeof frm Is Form2 then
frm.Text = "My Second Text"
else if...

end if

Next frm

VJ
<pa*******@verizon.net> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
I have an MDIList menu item that I want to enumerate at run-time and
possibly change the text shown for some of the MDI children included in
that list. When I enumerate the collection for that menu item, none of
the open MDI child windows show in the list although they are clearly
there in the actual drop-down of the menu item. Does anyone know how I
can enumerate the menu item that contains the MDIList at run-time and
change the text associated with some of the MDI children in that list?

Thank you.

Apr 19 '06 #2
Thanks for the feedback. Unfortunately I want to be able to keep the
text as is on the form title bar and only change the text that shows in
the menu's drop-down items. Under VB6 I was able to do just that using
miscellaneous APIs (GetMenu, GetSubMenu, etc.) but I'm not having any
success with those APIs within .Net so far.

Apr 19 '06 #3
VJ
uhmm...interesting.. Yes do remember the VB6.0 days... maybe there is a
Reason they removed it .NET. I assume you have tried the InterOp way, and it
did not work.. ?

VJ

<pa*******@verizon.net> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Thanks for the feedback. Unfortunately I want to be able to keep the
text as is on the form title bar and only change the text that shows in
the menu's drop-down items. Under VB6 I was able to do just that using
miscellaneous APIs (GetMenu, GetSubMenu, etc.) but I'm not having any
success with those APIs within .Net so far.

Apr 19 '06 #4
Yeah I know I'm in trouble as soon as the GetMenuItemCount API
completes because although that returns without an error, it also
returns with a crazy high number for menu items. The GetMenuItemInfo
that is used next fails with a System.AccessViolationException -
Attempted to read or write protected memory.....

Apr 20 '06 #5

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

Similar topics

1
by: Mayolo Juarez via DotNetMonster.com | last post by:
Hi, I have a problem, when i use a context menu in a MDIForm and activate the property "MDIList= True", the context menu don't show me the current child windows, please help me, i use VS2003. ...
1
by: Mayolo Juarez via DotNetMonster.com | last post by:
yes ina a contex menu i activate de the property mdilist and i canīt see the mdichild listed in the contexmenu, only dont show me the mdi child i use net framework 1.1 and vs2003, sll its correct...
2
by: Sisnaz | last post by:
I'm working with 2005 Beta 2 and I'm sure this is a trivial question but for the life of me I can't figure out. I placed a menu navigation componet on my master page and defined the navigation...
2
by: Massimo Zaccarin | last post by:
Hello, how can I exclude an MDI child Form from the list shown by a MenuItem with MDIList prop. set to True? Is there a way to do it? Thanks
0
by: Peter Proost | last post by:
Hi group, I was wondering if anyone has ever done this before, I've got a working ownerdrawn menu the only thing I can't get to work is to ownerdraw the items the get automaticaly created in a...
3
by: andreas | last post by:
I have many childs forms in a parent form. And I use mdiList in menu/windows When I minimize all these childs with a menu command I want that the selected child in the mdiLIst should open but it...
1
by: andreas | last post by:
I have a MDI form with a MdiList in a MenuItem And also 3 different child types, one child is like a background with a picturebox in it. So this must be always as background and never hide the...
3
by: Ricardo Maciel | last post by:
The How to page: http://msdn2.microsoft.com/en-us/library/7aw8zc76(VS.80).aspx walks through the creation of MDI child forms. It includes instructions to set the property MdiList to maintain a...
2
by: Fir5tSight | last post by:
Hi, I'm experimenting sample code created in Visual Studio 2002 (or 2003) in my Visual Studio 2005. However, I can't find the following in VS 2005: - MainMenu control in Toolbox; -...
0
by: JensB | last post by:
Hi I want to control the navigation between 7-8 childforms in my MDIparent form project with buttons instead of the build-in MdiList. I am able to show a Childform with this code:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.