Click here to Skip to main content
15,917,645 members
Home / Discussions / C#
   

C#

 
AnswerRe: creating a playlist of videos Pin
Christian Graus16-Apr-09 12:16
protectorChristian Graus16-Apr-09 12:16 
Generalcreating a playlist of videos Pin
mist_psycho16-Apr-09 19:51
mist_psycho16-Apr-09 19:51 
QuestionI am looking for a great C# learning book - trying to switch from VB.NET to C#. Pin
Slow Learner16-Apr-09 8:36
Slow Learner16-Apr-09 8:36 
AnswerRe: I am looking for a great C# learning book - trying to switch from VB.NET to C#. Pin
Eddy Vluggen16-Apr-09 8:45
professionalEddy Vluggen16-Apr-09 8:45 
GeneralRe: I am looking for a great C# learning book - trying to switch from VB.NET to C#. Pin
Slow Learner16-Apr-09 8:58
Slow Learner16-Apr-09 8:58 
AnswerRe: I am looking for a great C# learning book - trying to switch from VB.NET to C#. Pin
Mycroft Holmes16-Apr-09 15:06
professionalMycroft Holmes16-Apr-09 15:06 
GeneralRe: I am looking for a great C# learning book - trying to switch from VB.NET to C#. Pin
Slow Learner17-Apr-09 2:14
Slow Learner17-Apr-09 2:14 
QuestionListBox Binding Problem. Pin
hdv21216-Apr-09 8:32
hdv21216-Apr-09 8:32 
Hi i want to get list of all Forms in my current app by this code and display it's Name property to ListBox :

Assembly assembly = Assembly.GetEntryAssembly();
Type[] types = assembly.GetTypes();
FormsCollection forms = new FormsCollection(); // It's a class to hold array of Forms
foreach(Type t in types)
{
                if (t.BaseType == typeof(Form))
                {                    
                    Form frm = (Form)Activator.CreateInstance(t);
                    frm.Name = t.Name;
                    forms.Add(frm);
                }
}
this.listBox1.DataSource = forms;
this.listBox1.DisplayMember = "Name"; // This property does not display anyThing


Here is my FormsCollection class :

public class FormsCollection : CollectionBase
{
        public Form Add(Form frm)
        {
            base.List.Add(frm);
            return (frm);
        }

        public void Remove(Form frm)
        {
            base.List.Remove(frm);
        }

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


as u can see in above code (this.listBox1.DisplayMember = "Name";), i set displayMember of forms object to 'Name', but at runTime it does not display anything, whereas when i use this.listBox1.DisplayMember = "Text"; it display Text correctly. how to display 'Name' field ?
Thanks
AnswerRe: ListBox Binding Problem. Pin
Luc Pattyn16-Apr-09 9:03
sitebuilderLuc Pattyn16-Apr-09 9:03 
GeneralRe: ListBox Binding Problem. Pin
Henry Minute16-Apr-09 9:06
Henry Minute16-Apr-09 9:06 
GeneralRe: ListBox Binding Problem. Pin
hdv21216-Apr-09 9:35
hdv21216-Apr-09 9:35 
GeneralRe: ListBox Binding Problem. Pin
Luc Pattyn16-Apr-09 10:58
sitebuilderLuc Pattyn16-Apr-09 10:58 
GeneralRe: ListBox Binding Problem. Pin
Henry Minute16-Apr-09 11:05
Henry Minute16-Apr-09 11:05 
GeneralRe: ListBox Binding Problem. Pin
Henry Minute16-Apr-09 12:43
Henry Minute16-Apr-09 12:43 
GeneralRe: ListBox Binding Problem. Pin
Luc Pattyn16-Apr-09 13:15
sitebuilderLuc Pattyn16-Apr-09 13:15 
GeneralRe: ListBox Binding Problem. Pin
Dave Kreskowiak17-Apr-09 4:23
mveDave Kreskowiak17-Apr-09 4:23 
GeneralRe: ListBox Binding Problem. Pin
Luc Pattyn17-Apr-09 4:32
sitebuilderLuc Pattyn17-Apr-09 4:32 
GeneralRe: ListBox Binding Problem. [modified] Pin
Dave Kreskowiak17-Apr-09 4:44
mveDave Kreskowiak17-Apr-09 4:44 
GeneralRe: ListBox Binding Problem. Pin
Luc Pattyn17-Apr-09 5:16
sitebuilderLuc Pattyn17-Apr-09 5:16 
GeneralRe: ListBox Binding Problem. Pin
Dave Kreskowiak17-Apr-09 7:37
mveDave Kreskowiak17-Apr-09 7:37 
QuestionAxMsComm objet created dinamically in C# Pin
blackhattrick16-Apr-09 7:42
blackhattrick16-Apr-09 7:42 
AnswerRe: AxMsComm objet created dinamically in C# Pin
Luc Pattyn16-Apr-09 8:26
sitebuilderLuc Pattyn16-Apr-09 8:26 
GeneralRe: AxMsComm objet created dinamically in C# Pin
blackhattrick16-Apr-09 8:48
blackhattrick16-Apr-09 8:48 
QuestionRunning embedded WSF Script Pin
Planker16-Apr-09 7:25
Planker16-Apr-09 7:25 
QuestionReturn file name in gridview and link to the file Pin
newbie1234567891016-Apr-09 5:56
newbie1234567891016-Apr-09 5: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.