All methods do something about members of a class. The pre-requisite
is that the members had been defined before a method is defined. Now,
I need to add a new member into a class by a method, I mean to add a
new member into a class dynamically. Can I do it?
Application-wise is to control menu items. I don't know how many
selections a user would need, so I allow a user to add in. In
XXX.designer.cs file, a menu selection is a member that is initialized
by method of:
private void InitializeComponent()
Now my goal is to add a new member such as:
private System.Windows.Forms.ToolStripMenuItem
new_member_ToolStripMenuItem;
into my class dynamically. This new member
new_member_ToolStripMenuItem was not initialized by
InitializeComponent()
Can some guru help me out? Thanks a lot!
Muddy Coder