jespermohl Posted August 17, 2007 Posted August 17, 2007 (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 August 17, 2007 by jespermohl Quote
Administrators PlausiblyDamp Posted August 17, 2007 Administrators Posted August 17, 2007 What does the actual code for the public override string ToString() {...} method look like? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.