Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

My listbox displays an empty string when I add an form to it.

I tried to override ToString and set listbox.DisplayMember to a property.

It works when i use lbxHeader1.Items[1].ToString();

 

Does anybody have a clue what could be wrong?

 

 

This is my definitions:

 

 

public partial class TextDisplay : Form

{

 

public override string ToString() {...}

 

}

 

partial class Form1

{

this.lbxHeader1 = new System.Windows.Forms.ListBox();

}

 

public partial class Form1 : Form

{

private void lbxHeader1_MouseDoubleClick(object sender, MouseEventArgs e)

{

TextDisplay TextDispDialog = new TextDisplay();

lbxHeader1.Items.Add(TextDispDialog);

}

}

Edited by jespermohl

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...