Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
7
Reply
Inheritance / Polymorphism
Grant McConville
May 24 2011 2:25 AM
1.7k
Reply
Hi, I would like to know how to add a variable to collection or list in a inheriated class.
Any help would be much appreciated.
This is what I would to use it in
class MyGrid : DataGridView
{
// Code to add the enum MyStyle to the Columns Collection, calling it DisplayStyle
private void PaintCell(object sender, DataGridViewCellPaintingEventArgs e)
{
if (this.Columns[e.ColumnIndex].DisplayStyle == MyStyle.Currency)
{
// code here
}
}
enum MyStyle
{
Currency, Accounting, Other
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
7
)
Next Recommended Forum
Malayalam font in c sharp
Printer setup