How Select listview item to show it content into text box programmatically

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrar
    New Member
    • Dec 2011
    • 2

    #1

    How Select listview item to show it content into text box programmatically

    hello guys!
    i want select next row from listview to show it content in textbox with a shortcut key
    i test this:
    Code:
     private void textBox1_KeyDown(object sender, KeyEventArgs e)
    {
    if (e.KeyCode == Keys.F8)
    {
    int index = 0;
    index = this.listView1.SelectedIndices[0];
    listView1.Items[index+1].Selected = true;
    listView1.Select();
    this code don't show the contents just change selected to Blue color, only when i select with the mouse it works but with another code:
    Code:
    private void listView1_SelectedIndexChanged(object sender, EventArgs e)
    {
    TextBox1.Text = listView1.FocusedItem.SubItems[4].Text;
    }
  • mrar
    New Member
    • Dec 2011
    • 2

    #2
    i found it
    thanks for help ;)

    Comment

    Working...