473,324 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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

2
hello guys!
i want select next row from listview to show it content in textbox with a shortcut key
i test this:
Expand|Select|Wrap|Line Numbers
  1.  private void textBox1_KeyDown(object sender, KeyEventArgs e)
  2. {
  3. if (e.KeyCode == Keys.F8)
  4. {
  5. int index = 0;
  6. index = this.listView1.SelectedIndices[0];
  7. listView1.Items[index+1].Selected = true;
  8. 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:
Expand|Select|Wrap|Line Numbers
  1. private void listView1_SelectedIndexChanged(object sender, EventArgs e)
  2. {
  3. TextBox1.Text = listView1.FocusedItem.SubItems[4].Text;
  4. }
Dec 27 '11 #1

✓ answered by mrar

i found it
thanks for help ;)

1 5605
mrar
2
i found it
thanks for help ;)
Dec 28 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Patrick De Ridder | last post by:
In a list view with various columns with numbers, I would like to give a few numbers a different color. I would be happy to know how can it be done. Many thanks. -- Regards, Patrick.
0
by: Islam Elkhayat | last post by:
In my Application i search my Employee database and view result in List View with 3 column.. here is the code: ######################################### private void textBox1_TextChanged(object...
4
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't...
5
by: Phill W. | last post by:
(VB'2003) What's the correct way to remove multiple, selected items from a ListView control (say, from a ContextMenu)? I ask because I'm getting a very annoying ArgumentOutOfRangeException...
5
by: Bart Steur | last post by:
Hi, What's the best way to programmaticly select (click) another listview Item after removing the selected/focused one. using VB2005 Express. Thanks Bart
7
by: Brad Pears | last post by:
I have something strange going on - pretty sure it used to work before - and now it does not... Why does the following code not clear a combo box? Me.cboLocation.Text = String.Empty OR ...
1
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I would like to keep passwords in a ListView item but have them display as asterisks or som other arbitrary character. This is easy in a text box by settin the appropriate attribute but...
4
by: Brandon | last post by:
HI all, I am working on a WPF listview that get items through the XMLDataProvider and making a listview with two actual columns and in both CellTemplete XAML in a grid bind more than one snippet...
2
by: Condor06 | last post by:
I have a list view with few items, and I want to select, for example, first item (from code)! Very simple, but... QListView haven't something like "selectItem(index)" (like QTableView has...
1
by: Romeu Januario | last post by:
Hi everyone, how can i select an item from a directory and export the full name of it (for example test.txt) to an variable the code on the dir list that i have is: <?php $show_path = 1; ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.