CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2011
    Posts
    69

    Question Make the selected text of a listbox the text inside a textbox

    Do you know how to make the selected text of a listbox the text inside a textbox?

    I tried this but its not working:

    Code:
    string[] details = { listBox4.SelectedItem.ToString() };
     textBox5.Text = details[0];

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Make the selected text of a listbox the text inside a textbox

    Are you handling the SelectedIndex changed event?

    What happens when you set a break point on the following line
    Code:
    textBox5.Text = details[0];
    and inspect the details variable in the watch window (or by hovering over it)?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured