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

Control.ControlForm.Menu

Hi, everybody!

I create a control inherited from System.Windows.Forms.Control and override
OnParentChanged method:

public class MyControl : System.Windows.Forms.Control
{
protected override void OnParentChanged(System.EventArgs e)

{

// I look for current parent form

System.Windows.Forms.Form frm = this.FindForm();

// and I want to change the parent form Menu:

frm.Menu.Add(...);

and have a problem: creation sequence from the parent form create MyControl
before assign Menu to actual form Menu.

Say please can I monitoring Form.Menu assign ?

Thanks avanced.

--

WBR, Roman S. Golubin

PS: Sorry for bad english.


Nov 15 '05 #1
1 1385
I wrote:

Say please can I monitoring Form.Menu assign ?


I see as solution for this problem inheritance System.Windows.Forms.Form to
myself MyFormClass, override property Menu and inherite all my forms from it
and this method don't well for me ;-((

I use dotnetframework v1.0.3705 at this time and don't sure that migration
to 1.1.4322 solve this problem??

Does anyone say why Microsoft add ContextMenuChanged event to Control class
and don't add MenuChanged event to Form??

-- code for MyForm inherited from ****invalid**** System.Windows.Forms.Form
: --

public class Form : System.Windows.Forms.Form
{
public event EventHandler MenuChanged;
public new System.Windows.Forms.MainMenu Menu
{
get
{
return base.Menu;
}
set
{
base.Menu = value;
if (MenuChanged != null)
{
MenuChanged(this, EventArgs.Empty);
}
}
}
}

--
Thanks a lot for any help
Roman S. Golubin
Nov 15 '05 #2

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

Similar topics

2
by: zapazap | last post by:
Dear Snake Charming Gurus, (Was: http://mail.python.org/pipermail/python-list/2004-January/204454.html) First, a thank you to Tim Golden, Thomas Heller, and Mark Hammond for your earlier help...
7
by: Smithers | last post by:
I have a non trivial ASP.NET Web application that implements its navigation system via a user control (menu.ascx) placed on every page. It is important to note that the user control that hosts...
7
by: Chuck Hartman | last post by:
I have a Windows service that requests web pages from a site using an HttpWebRequest object. When I try to request a page from an ASP.NET 2 site, I get a WebException with message "The remote...
7
by: Siv | last post by:
Hi, I have an MDI application that uses a generic "ShowPage" routine in a module that is called when I want to display a child form. The basic idea is that in the module I have declared each form...
0
by: Umut Tezduyar | last post by:
I really hate working with .net framework design time attributes. I have read asp.net server controls and components (Nikhil Kothari, Vandana Datye) book, chapter 15 but still i can't handle the...
2
by: Lucky | last post by:
hi guys, i'm working on the context menu for the controls. the problem i'm facing right now is like this : i want to use one context menu for more then one controls lets say i want to use one...
5
by: Brad Isaacs | last post by:
Good morning friends, I am working with ASP.NET 2.0 -- VB code behind I have created tabbed pages using the Menu control with the Multiview control. Using the menu control to display the...
2
by: MCM | last post by:
I'm working on a plotting control. The plotting control will have a context menu with basic commands for "scaling", "zooming", etc. Is there a way that, from the parent form, I can add more...
5
by: AG | last post by:
I realize that the obvious suggestion would be malware, but my definitions are up to date and I have already scanned for it. I have also tried disabling all IE add-ons. I just rebuilt and...
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: 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...
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
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,...

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.