Click here to Skip to main content
15,793,535 members
Home / Discussions / C#
   

C#

 
GeneralRe: 64 bit / IME / WindowsHook problem Pin
Daniel Grunwald22-Apr-06 3:06
Daniel Grunwald22-Apr-06 3:06 
QuestionSwitching from DG tp DGV !!!???!!!???!!!??? Pin
mrkeivan21-Apr-06 10:44
mrkeivan21-Apr-06 10:44 
AnswerRe: Switching from DG tp DGV !!!???!!!???!!!??? Pin
Josh Smith21-Apr-06 11:04
Josh Smith21-Apr-06 11:04 
QuestionHow to find what file/s was selected by mouse? Pin
FocusedWolf21-Apr-06 9:35
FocusedWolf21-Apr-06 9:35 
AnswerRe: How to find what file/s was selected by mouse? Pin
Paul Brower21-Apr-06 11:14
Paul Brower21-Apr-06 11:14 
AnswerRe: How to find what file/s was selected by mouse? Pin
John C. Doe21-Apr-06 15:09
John C. Doe21-Apr-06 15:09 
AnswerRe: How to find what file/s was selected by mouse? Pin
John C. Doe21-Apr-06 15:11
John C. Doe21-Apr-06 15:11 
QuestionUsing CollectionBase Pin
JuanAlbertoMD21-Apr-06 9:06
JuanAlbertoMD21-Apr-06 9:06 
Hello!!

I have created my own collection :

[TypeConverter(typeof(MyCollectionConverter))]<br />
    public class MyCollection<br />
    {<br />
        <br />
        private Color color1 = Color.White;<br />
        private Color color2 = Color.Black;<br />
        private int value1 = 0;<br />
        private int value2 = 0;<br />
        private bool blink = false;<br />
        private bool visible = true;<br />
        private string nname = string.Empty;        <br />
                <br />
        [Browsable(true)]<br />
        public Color Color1<br />
        {<br />
            get { return color1; }<br />
            set { color1 = value; }<br />
        }<br />
<br />
        [Browsable(true)]<br />
        public Color Color2<br />
        {<br />
            get { return color2; }<br />
            set { color2 = value; }<br />
        }<br />
<br />
        [Browsable(true)]<br />
        public int Value1<br />
        {<br />
            get { return value1; }<br />
            set { value1 = value; }<br />
        }<br />
<br />
        [Browsable(true)]<br />
        public int Value2<br />
        {<br />
            get { return value2; }<br />
            set { value2 = value; }<br />
        }<br />
<br />
        [Browsable(true)]<br />
        public bool Blink<br />
        {<br />
            get { return blink; }<br />
            set { blink = value; }<br />
        }<br />
<br />
        [Browsable(true)]<br />
        public bool Visible<br />
        {<br />
            get { return visible; }<br />
            set { visible = value; }<br />
        }<br />
<br />
        [Browsable(true)]<br />
        public string Name<br />
        {<br />
            get { return name; }<br />
            set { name = value; }<br />
        }        <br />
<br />
        public MyCollection()<br />
        {<br />
        }<br />
    }


public class MyCollectionConverter : CollectionBase<br />
    {<br />
        public MyCollectionConverter ()<br />
        {<br />
        }<br />
<br />
        public int Add(MyCollectione)<br />
        {<br />
            return this.InnerList.Add(e);<br />
        }<br />
<br />
        public void AddRange(MyCollection[] es)<br />
        {<br />
            this.InnerList.AddRange(es);<br />
        }<br />
<br />
        public void Remove(MyCollectione)<br />
        {<br />
            InnerList.Remove(e);<br />
        }<br />
<br />
        public new void RemoveAt(int index)<br />
        {<br />
            InnerList.RemoveAt(index);<br />
        }<br />
<br />
        public bool Contains(MyCollection e)<br />
        {<br />
            return InnerList.Contains(e);<br />
        }<br />
<br />
        public MyCollection this[int index]<br />
        {<br />
            get { return (MyCollection)this.InnerList[index]; }<br />
            set { this.InnerList[index] = value; }<br />
        }<br />
    }


and in a click event i add some elements to the collection like this:

MyCollectionConverter myCollectionConverter = new MyCollectionConverter ();

for ( int i = 0; i < 5; i++ )
{
MyCollection myCollection = new MyCollection();
myCollection.Name = "Element " + i.ToString();

myCollectionConverter.Add(myCollection);
}

and then i show myCollectionConverter in a PropertyGrid, when i open the Collection editor i can see all the elements.

My question is how can i disable the add and remove buttons in the Collection editor this because i don't want that a user can add more elements.

This is possible?

Somebody know how can i do that?

Regards,
Alberto Martinez
AnswerRe: Using CollectionBase Pin
Josh Smith21-Apr-06 11:09
Josh Smith21-Apr-06 11:09 
QuestionHow to add textbox or combobox to toolbar Pin
pliu_200021-Apr-06 8:40
pliu_200021-Apr-06 8:40 
AnswerRe: How to add textbox or combobox to toolbar Pin
Ravi Bhavnani21-Apr-06 9:13
professionalRavi Bhavnani21-Apr-06 9:13 
QuestionEnumerating CD/DVD Drives Pin
Joel Holdsworth21-Apr-06 7:34
Joel Holdsworth21-Apr-06 7:34 
AnswerRe: Enumerating CD/DVD Drives Pin
Paul Brower21-Apr-06 8:38
Paul Brower21-Apr-06 8:38 
QuestionCreating, Showing, Returning values with Windows Forms. Pin
RanvA21-Apr-06 7:26
RanvA21-Apr-06 7:26 
AnswerRe: Creating, Showing, Returning values with Windows Forms. Pin
Zultan21-Apr-06 8:02
Zultan21-Apr-06 8:02 
GeneralRe: Creating, Showing, Returning values with Windows Forms. Pin
RanvA21-Apr-06 8:06
RanvA21-Apr-06 8:06 
QuestionCan We make it & what is the source code? Pin
Waheed Akbar21-Apr-06 6:37
Waheed Akbar21-Apr-06 6:37 
AnswerRe: Can We make it & what is the source code? Pin
Dave Kreskowiak21-Apr-06 8:32
mveDave Kreskowiak21-Apr-06 8:32 
GeneralRe: Can We make it & what is the source code? Pin
mr_1234521-Apr-06 13:22
mr_1234521-Apr-06 13:22 
GeneralRe: Can We make it & what is the source code? Pin
Dave Kreskowiak21-Apr-06 14:12
mveDave Kreskowiak21-Apr-06 14:12 
QuestionProblem With CrystalReport Wiewer Pin
DavoodValipour21-Apr-06 6:11
DavoodValipour21-Apr-06 6:11 
QuestionRunning an sql query in c# Pin
nomsnoms21-Apr-06 5:45
nomsnoms21-Apr-06 5:45 
AnswerRe: Running an sql query in c# Pin
Colin Angus Mackay21-Apr-06 6:50
Colin Angus Mackay21-Apr-06 6:50 
GeneralRe: Running an sql query in c# Pin
Paul Conrad21-Apr-06 8:54
professionalPaul Conrad21-Apr-06 8:54 
AnswerRe: Running an sql query in c# Pin
Paul Brower21-Apr-06 6:56
Paul Brower21-Apr-06 6:56 

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.