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

FindFormForMenuItem

I can't figure out how to find the Form for a MenuItem is on using a reference to the
MenuItem only? I'm looking for something like the FindForm method for controls. I
finally figured out how do do it for components (see below), but I can't figure out
how to do something similar for menu items. Any ideas?

Thanks in Advance - JackRazz
Public Shared Function FindFormForComponent(ByVal component As
System.ComponentModel.Component) As Form
Dim i As Integer
Dim container As System.ComponentModel.IContainer = component.Site.Container
Dim components As System.ComponentModel.ComponentCollection =
component.Site.Container.Components
For i = 0 To components.Count - 1
component = CType(components.Item(i), Component)
Dim parentForm As Form
If TypeOf component Is Form Then
Return CType(component, Form)
End If
Next
End Function

Nov 16 '05 #1
1 1092
"JackRazz" <Ja******@NotValid.com> schrieb
I can't figure out how to find the Form for a MenuItem is on using a
reference to the MenuItem only? I'm looking for something like the
FindForm method for controls. I finally figured out how do do it for
components (see below), but I can't figure out how to do something
similar for menu items. Any ideas?

AFAIS it is not possible. Why do you need it? Maybe you could raise an event
handled by the Form instead? BTW, a menuItem *is* a component.
Please post only to the appropriate groups next time.
--
Armin

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

Nov 16 '05 #2

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

Similar topics

4
by: JackRazz | last post by:
Is there a way to get a components parent form from within the component? Thanks - JackRazz
8
by: JackRazz | last post by:
I can't figure out how to find the Form for a MenuItem is on using a reference to the MenuItem only? I'm looking for something like the FindForm method for controls. I finally figured out how do...
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.