TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
chrisaldi20
NA
24
0
Casting a Custom Class
Apr 5 2004 9:35 PM
Hi, I have a problem regarding casting a custom class I created. The situation is this... I created a menu item in the mdi with a corresponding click eventhandler, I passed a certain parameter on this menuitem by using a custom class I created that inherited a MenuItem class. the codes of the class I created is shown below: using System; using System.Windows.Forms; namespace WarehouseMDI { public class MenuItemEx : MenuItem { private string assemblyname; public MenuItemEx() { } public string AssemblyName { get{return assemblyname;} set{assemblyname = value;} } } } on the menu item click event: private void Menu_Clicked(object sender, EventArgs e) { MenuItemEx item = (MenuItemEx) sender; <---Specified Cast not valid MessageBox.Show(item.AssemblyName); } when I use the quick watch on the sender parameter, the AssemblyName is there with its corresponding value. How can I cast this object so that I may be able to view the custom property I created? Any help would be greatly appreciated! thanks, Chris
Reply
Answers (
0
)
Accessing controls in diffrent form
convert timespan datedifferents to float or int values .. plzz