Click here to Skip to main content
15,887,812 members
Home / Discussions / C#
   

C#

 
GeneralRe: Creating a Class that can be a list? Pin
Luc Pattyn28-Dec-09 12:19
sitebuilderLuc Pattyn28-Dec-09 12:19 
AnswerRe: Creating a Class that can be a list? Pin
Saksida Bojan28-Dec-09 5:37
Saksida Bojan28-Dec-09 5:37 
AnswerRe: Creating a Class that can be a list? Pin
#realJSOP28-Dec-09 9:44
mve#realJSOP28-Dec-09 9:44 
QuestionFew questions Pin
Saksida Bojan28-Dec-09 5:04
Saksida Bojan28-Dec-09 5:04 
AnswerRe: Few questions Pin
ProtoBytes28-Dec-09 6:48
ProtoBytes28-Dec-09 6:48 
GeneralRe: Few questions Pin
Saksida Bojan28-Dec-09 8:50
Saksida Bojan28-Dec-09 8:50 
GeneralRe: Few questions Pin
ProtoBytes28-Dec-09 9:15
ProtoBytes28-Dec-09 9:15 
AnswerRe: Few questions Pin
DaveyM6928-Dec-09 10:42
professionalDaveyM6928-Dec-09 10:42 
1. You can either use an interface or an abstract class depending on what suits your needs best.

2. This is possible by creating new properties the same as the old and applying certain attributes (overriding instead of new may work - I seem to recall having problems that way). The control will need to be compiled to a separate assembly, if in the same assembly as the project, or in a referenced project then the attributes will have no effect!

C#
public class MyControl : Control
{
    [Browsable(false),
    DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
    EditorBrowsable(EditorBrowsableState.Never),
    ObsoleteAttribute("This property is not valid for this control")]
    public new string Text
    {
        get { return base.Text; }
        set { base.Text = value; }
    }
}
This isn't foolproof though as the end user can always treat your control as Control and have access to all the stuff that Control has. It's also against OOP priciples to inherit stuff you don't want, but in the case of Control there isn't much option and even MS themselves do it!

Dave

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus)

GeneralRe: Few questions Pin
Saksida Bojan28-Dec-09 11:33
Saksida Bojan28-Dec-09 11:33 
GeneralRe: Few questions Pin
ProtoBytes28-Dec-09 12:12
ProtoBytes28-Dec-09 12:12 
QuestionNetwork permission for Windows service Pin
Priya Prk28-Dec-09 4:56
Priya Prk28-Dec-09 4:56 
AnswerRe: Network permission for Windows service Pin
Blikkies28-Dec-09 5:33
professionalBlikkies28-Dec-09 5:33 
AnswerRe: Network permission for Windows service Pin
Dave Kreskowiak28-Dec-09 5:33
mveDave Kreskowiak28-Dec-09 5:33 
GeneralRe: Network permission for Windows service Pin
Priya Prk28-Dec-09 6:07
Priya Prk28-Dec-09 6:07 
Question[Message Deleted] Pin
santhosh-padamatinti28-Dec-09 2:14
santhosh-padamatinti28-Dec-09 2:14 
AnswerRe: please answer Pin
Dave Kreskowiak28-Dec-09 3:56
mveDave Kreskowiak28-Dec-09 3:56 
Questioninsert datetime to database Pin
Erdinc2728-Dec-09 1:48
Erdinc2728-Dec-09 1:48 
AnswerRe: insert datetime to database Pin
OriginalGriff28-Dec-09 2:14
mveOriginalGriff28-Dec-09 2:14 
GeneralRe: insert datetime to database Pin
Erdinc2728-Dec-09 2:53
Erdinc2728-Dec-09 2:53 
GeneralRe: insert datetime to database Pin
Blue_Boy28-Dec-09 3:12
Blue_Boy28-Dec-09 3:12 
GeneralRe: insert datetime to database Pin
Luc Pattyn28-Dec-09 3:26
sitebuilderLuc Pattyn28-Dec-09 3:26 
GeneralRe: insert datetime to database Pin
OriginalGriff28-Dec-09 4:13
mveOriginalGriff28-Dec-09 4:13 
Questionfetch distinct record from the custom data type in ado.net entity framework Pin
Pankaj Saha27-Dec-09 22:29
Pankaj Saha27-Dec-09 22:29 
Questionhow do i differentiate between the two tables Pin
@nisha 2n27-Dec-09 22:24
@nisha 2n27-Dec-09 22:24 
AnswerRe: how do i differentiate between the two tables Pin
ProtoBytes28-Dec-09 10:52
ProtoBytes28-Dec-09 10:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.