Click here to Skip to main content
15,897,187 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to make a windows form with an arrow Pin
Jason_Shen24-Dec-08 22:27
Jason_Shen24-Dec-08 22:27 
GeneralRe: how to make a windows form with an arrow Pin
Christian Graus25-Dec-08 0:14
protectorChristian Graus25-Dec-08 0:14 
GeneralRe: how to make a windows form with an arrow Pin
Dragonfly_Lee25-Dec-08 0:43
Dragonfly_Lee25-Dec-08 0:43 
GeneralRe: how to make a windows form with an arrow Pin
Jason_Shen25-Dec-08 4:50
Jason_Shen25-Dec-08 4:50 
QuestionCan't figure out where this code might be going wrong Pin
SteelIXB24-Dec-08 15:29
SteelIXB24-Dec-08 15:29 
QuestionHow to add IP address to DNS server? Pin
s196675m24-Dec-08 12:13
s196675m24-Dec-08 12:13 
AnswerRe: How to add IP address to DNS server? Pin
Dragonfly_Lee24-Dec-08 16:17
Dragonfly_Lee24-Dec-08 16:17 
QuestionUsing collection with Designer/Editor Pin
kanchoette24-Dec-08 8:39
kanchoette24-Dec-08 8:39 
Iam working on creating a multi-column combo box for myself. I would like coders to be able to use the designer and collection editor dialogs. Right now the collection does not show up in the component's properties panel. What am I doing wrong please? Here's what I have so far ...

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Collections;
using System.ComponentModel.Design;
using System.Drawing.Design;

namespace MultiColumnComboBox
{
    public partial class MultiColumnComboBox : ComboBox
    {
        public MultiColumnComboBox()
        {
            InitializeComponent();
        }

        public MultiColumnComboBox(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }

        public class Column
        {
            public Column()
            {

            }

            #region private variables
            private Color foreColor;
            private Color backColor;
            private int columnWidth;
            private bool autoWidth = false;
            private string columnType;
            #endregion

            public Color ForeColor
            {
                get { return foreColor; }
                set { foreColor = value; }
            }

            public Color BackColor
            {
                get { return backColor; }
                set { backColor = value; }      
            }

            public int ColumnWidth
            {
                get { return columnWidth; }
                set { columnWidth = value; }
            }

            public bool AutoWidth
            {
                get { return autoWidth; }
                set { autoWidth = value; }
            }

            public string ColumnType
            {
                get { return columnType; }
                set { columnType = value; }
            }
            
            [Editor(typeof(ColumnCollectionEditor),(typeof( UITypeEditor)))]
            public class ColumnCollection : CollectionBase
            {
                public ColumnCollection()
                {

                }

                public Column this[int index]
                {
                    get { return (Column)this.List[index]; }
                    set { this.List[index] = value; }
                }


                public int IndexOf(Column item)
                {

                    return base.List.IndexOf(item);

                }



                public int Add(Column item)
                {

                    return this.List.Add(item);

                }



                public void Remove(Column item)
                {

                    this.InnerList.Remove(item);

                }



                public void CopyTo(Array array, int index)
                {

                    this.List.CopyTo(array, index);

                }



                public void AddRange(ColumnCollection collection)
                {

                    for (int i = 0; i < collection.Count; i++)
                    {

                        this.List.Add(collection[i]);

                    }

                }



                public void AddRange(Column[] collection)
                {

                    this.AddRange(collection);

                }



                public bool Contains(Column item)
                {

                    return this.List.Contains(item);

                }



                public void Insert(int index, Column item)
                {

                    this.List.Insert(index, item);

                }
            }

            public class ColumnCollectionEditor : CollectionEditor
            {
                public ColumnCollectionEditor(Type type)
                    : base(type)
                {

                }
            }
        }
    }
}

AnswerRe: Using collection with Designer/Editor Pin
Not Active24-Dec-08 9:55
mentorNot Active24-Dec-08 9:55 
GeneralRe: Using collection with Designer/Editor Pin
kanchoette25-Dec-08 1:45
kanchoette25-Dec-08 1:45 
QuestionHow Do I Run A Command Prompt Command? Pin
That Asian Guy24-Dec-08 7:10
That Asian Guy24-Dec-08 7:10 
AnswerRe: How Do I Run A Command Prompt Command? Pin
User 665824-Dec-08 7:14
User 665824-Dec-08 7:14 
GeneralRe: How Do I Run A Command Prompt Command? Pin
That Asian Guy24-Dec-08 7:19
That Asian Guy24-Dec-08 7:19 
GeneralRe: How Do I Run A Command Prompt Command? Pin
User 665824-Dec-08 7:21
User 665824-Dec-08 7:21 
GeneralRe: How Do I Run A Command Prompt Command? Pin
Colin Angus Mackay24-Dec-08 7:24
Colin Angus Mackay24-Dec-08 7:24 
GeneralRe: How Do I Run A Command Prompt Command? Pin
That Asian Guy24-Dec-08 7:25
That Asian Guy24-Dec-08 7:25 
GeneralRe: How Do I Run A Command Prompt Command? Pin
Dave Kreskowiak24-Dec-08 9:02
mveDave Kreskowiak24-Dec-08 9:02 
QuestionRemotely Turn off computer monitor Pin
balu1234524-Dec-08 6:57
balu1234524-Dec-08 6:57 
AnswerRe: Remotely Turn off computer monitor Pin
#realJSOP24-Dec-08 7:17
professional#realJSOP24-Dec-08 7:17 
GeneralRe: Remotely Turn off computer monitor Pin
Giorgi Dalakishvili24-Dec-08 8:11
mentorGiorgi Dalakishvili24-Dec-08 8:11 
AnswerRe: Remotely Turn off computer monitor Pin
Dave Kreskowiak24-Dec-08 9:00
mveDave Kreskowiak24-Dec-08 9:00 
Questionhow to send key from wordpad to c# app Pin
VyTrx24-Dec-08 6:55
VyTrx24-Dec-08 6:55 
AnswerRe: how to send key from wordpad to c# app Pin
#realJSOP24-Dec-08 7:18
professional#realJSOP24-Dec-08 7:18 
AnswerRe: how to send key from wordpad to c# app Pin
Not Active24-Dec-08 8:21
mentorNot Active24-Dec-08 8:21 
Questionproblem when i click on pdf it gives ":too many arguments" Pin
bhatted24-Dec-08 6:46
bhatted24-Dec-08 6:46 

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.