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

How to cast control to toolstripmenuitem

I need to be able to separate toolstripmenuitems from toolstripseparators,
both of which are children of a toolstripdropdropbutton. The last statement
does not pass validation. Is there any way to cast a control to a
toolstripmenuitem?

Dim ctl As Control

For Each itm In mni.DropDownItems

If ctl.GetType() Is Type.GetType("ToolStripMenuItem") Then

Dim itm As ToolStripMenuItem = DirectCast(ctl, ToolStripMenuItem)

Thanks,

Dean S
Jul 23 '07 #1
0 2318

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

Similar topics

5
by: Marc | last post by:
Hello, I have a vb.net form that I've added a StatusStrip at the bottom. On that StatusStrip I've added a DropDownButton on which I've added a Menu containing 4 sub Items
2
by: Manekurt | last post by:
Hello to everyone, I have this code, that gives me an error on the marked line. It is to make a reference to a submenuitem, to enable it thorgh it name. Error line: For Each oSubitem As...
15
by: cj | last post by:
I would like to have menu items a main menu bar that represent the days of the week. When you click on them they alternate from checked to unchecked. Right now I have 7 subs that look like this...
3
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
I need to show a custom control in the DropDown of a Windows.Forms.ToolStripMenuItem (e.g., similar to the Font Color menu item in Word except that the control is specific to my application). I...
3
by: Martijn Mulder | last post by:
My application has a standard MenuStrip on top of the window and a ContextMenuStrip that pops up when the user clicks the right mouse button. I have defined a ToolStripMenuItem that I want to...
0
by: kyungdongkim | last post by:
Hi, I have a dynamically generated MenuStrip following this example: http://www.codeproject.com/useritems/Dynamic_MenuStrip.asp Basically the menu strip allows users to save and load reports. ...
8
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I created a user control that handles certain keystrokes, e.g. Ctrl-C for cut, Ctrl-V for paste, plus other more specialized keystrokes. I want to list these in the menubar like any other menu...
3
by: eljainc | last post by:
Hello, I am trying to figure out how to efficiently do the following: Say I have 10 TextBox fields on a form. From each of those, I would like to have a right click context menu. There are 10...
2
by: Andrus | last post by:
If focused control is ReadOnly, menu shortcut key is ignored. To reproduce, run code below, press Ctrl+E. Note that message box does not appear. This issue blocks Ctrl+E usage in application....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.