Click here to Skip to main content
15,902,839 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: SDI vs. MDI: Old question, new parameters Pin
Arindam Sinha1-Aug-09 1:53
Arindam Sinha1-Aug-09 1:53 
QuestionProblem with image dimensions being reversed Pin
Alan Burkhart29-Jul-09 14:34
Alan Burkhart29-Jul-09 14:34 
AnswerRe: Problem with image dimensions being reversed Pin
Luc Pattyn29-Jul-09 21:33
sitebuilderLuc Pattyn29-Jul-09 21:33 
GeneralRe: Problem with image dimensions being reversed Pin
Alan Burkhart30-Jul-09 13:03
Alan Burkhart30-Jul-09 13:03 
QuestionHow to find out a file location Using C language in windows programming? Pin
WindowsVsLinux28-Jul-09 21:32
WindowsVsLinux28-Jul-09 21:32 
AnswerRe: How to find out a file location Using C language in windows programming? Pin
Dave Kreskowiak29-Jul-09 1:31
mveDave Kreskowiak29-Jul-09 1:31 
GeneralRe: How to find out a file location Using C language in windows programming? Pin
WindowsVsLinux29-Jul-09 1:33
WindowsVsLinux29-Jul-09 1:33 
QuestionHow to programmatically add items to CollectionEditor's list. [modified] Pin
ravtos27-Jul-09 22:54
ravtos27-Jul-09 22:54 
Hello!

I have a custom collection editor which inherits after CollectionEditor class (System.ComponentModel.Design)and I want to programmatically add items to it's collection (listbox).
There is a method 'AddItems' which takes a collection object and items to add, but I cannot figure out what collection object I should pass to it.. So my question is, how I can get to CollectionEditor's inner item's list?

[update]
Ugh.. proper method name is 'SetItems'
[/update]

[update 2 - source code]
public class MyCollectionEditor : CollectionEditor
{
        private Type m_itemType = null;

        public MyCollectionEditor(Type type)
                : base(type)
        {
                m_itemType = type;
        }

        protected override CollectionForm CreateCollectionForm()
        {
                Button buttonLoadItem = new Button();
                buttonLoadItem.Text = "Load from DB";
                buttonLoadItem.Click += new EventHandler(ButtonLoadItem_Click);

                m_collectionForm = base.CreateCollectionForm();

                TableLayoutPanel panel1 = m_collectionForm.Controls[0] as TableLayoutPanel;
                TableLayoutPanel panel2 = panel1.Controls[1] as TableLayoutPanel;
                panel2.Controls.Add(buttonLoadItem);

                return m_collectionForm;
        }

        private void ButtonLoadItem_Click(object sender, EventArgs e)
        {
                if (m_itemType.Equals(typeof(MyCustomCollection)))
                {                               
                        MyCustomItem item = ...load from DB...

                        //definition: SetItems(object editValue, object[] value);
                        SetItems( -> what goes here?! <- , new object[] { item });
                }
        }
}

[/update]

A man has got to know his limitations.
Harry Callahan

modified on Tuesday, July 28, 2009 6:34 AM

AnswerRe: How to programmatically add items to CollectionEditor's list. Pin
ravtos28-Jul-09 1:33
ravtos28-Jul-09 1:33 
QuestionNeed examples of extra nice program UI’s built for free with Windows Forms Pin
copec27-Jul-09 18:04
copec27-Jul-09 18:04 
AnswerRe: Need examples of extra nice program UI’s built for free with Windows Forms [modified] Pin
Sk9327-Jul-09 23:57
Sk9327-Jul-09 23:57 
GeneralRe: Need examples of extra nice program UI’s built for free with Windows Forms Pin
copec28-Jul-09 3:27
copec28-Jul-09 3:27 
GeneralRe: Need examples of extra nice program UI’s built for free with Windows Forms Pin
Dave Kreskowiak28-Jul-09 3:45
mveDave Kreskowiak28-Jul-09 3:45 
GeneralRe: Need examples of extra nice program UI’s built for free with Windows Forms Pin
copec28-Jul-09 3:58
copec28-Jul-09 3:58 
GeneralRe: Need examples of extra nice program UI’s built for free with Windows Forms Pin
Sk9328-Jul-09 4:24
Sk9328-Jul-09 4:24 
GeneralRe: Need examples of extra nice program UI’s built for free with Windows Forms Pin
Dave Kreskowiak28-Jul-09 7:37
mveDave Kreskowiak28-Jul-09 7:37 
GeneralRe: Need examples of extra nice program UI’s built for free with Windows Forms [modified] Pin
copec28-Jul-09 10:24
copec28-Jul-09 10:24 
GeneralRe: Need examples of extra nice program UI’s built for free with Windows Forms Pin
Dave Kreskowiak28-Jul-09 16:34
mveDave Kreskowiak28-Jul-09 16:34 
AnswerRe: Need examples of extra nice program UI’s built for free with Windows Forms Pin
Mycroft Holmes2-Aug-09 0:11
professionalMycroft Holmes2-Aug-09 0:11 
Questionwhat a good software Pin
sudyyang27-Jul-09 16:33
sudyyang27-Jul-09 16:33 
AnswerRe: what a good software Pin
Dave Kreskowiak27-Jul-09 17:20
mveDave Kreskowiak27-Jul-09 17:20 
AnswerRe: what a good software Pin
Mycroft Holmes27-Jul-09 17:42
professionalMycroft Holmes27-Jul-09 17:42 
Question? SET PASSWORD THROUGH CODE in Connectionstring Pin
Kutbi Naharpura27-Jul-09 4:44
Kutbi Naharpura27-Jul-09 4:44 
AnswerRe: ? SET PASSWORD THROUGH CODE in Connectionstring Pin
Sk9328-Jul-09 0:31
Sk9328-Jul-09 0:31 
QuestionDataGridView ComboBox VB.Net Pin
KiwiDanChCh26-Jul-09 22:53
KiwiDanChCh26-Jul-09 22:53 

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.