473,386 Members | 1,757 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,386 software developers and data experts.

listview and label display

Hello
I have a listview that displays a list of choices
When the mouse moves over each item, I would like text (the name of the item that is being hovered over) to show u
in a seperate label or textbox
How do I set this
Thanks
Ambe

Nov 20 '05 #1
2 2398
Hello,

Create a MouseMove event on the listview in question,

Inside this event place the following code:

Dim SelectedItem As ListViewItem = lvwFiles.GetItemAt(e.X, e.Y)
If Not SelectedItem Is Nothing Then
MyLabel.Text = SelectedItem.Text
End If

This snippet of code will retrieve the list view item at the position of the
mouse and if a valid item was found set a label's text to the text of the
item. Change MyLabel to the name of your label etc.

Hope this helps
Cheers
Simon

--
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:si****@headfirst.co.uk
-

"amber" <an*******@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.com...
Hello,
I have a listview that displays a list of choices.
When the mouse moves over each item, I would like text (the name of the
item that is being hovered over) to show up
in a seperate label or textbox.
How do I set this?
Thanks,
Amber

Nov 20 '05 #2
Hello,

Create a MouseMove event on the listview in question,

Inside this event place the following code:

Dim SelectedItem As ListViewItem = lvwFiles.GetItemAt(e.X, e.Y)
If Not SelectedItem Is Nothing Then
MyLabel.Text = SelectedItem.Text
End If

This snippet of code will retrieve the list view item at the position of the
mouse and if a valid item was found set a label's text to the text of the
item. Change MyLabel to the name of your label etc.

Hope this helps
Cheers
Simon

--
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:si****@headfirst.co.uk
-

"amber" <an*******@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.com...
Hello,
I have a listview that displays a list of choices.
When the mouse moves over each item, I would like text (the name of the
item that is being hovered over) to show up
in a seperate label or textbox.
How do I set this?
Thanks,
Amber

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to...
0
parshupooja
by: parshupooja | last post by:
Contact Reply 1 point Member propoo Joined on 08-31-2007, 10:32 PM Posts 3 Hey all ,
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
0
by: =?Utf-8?B?TWlrZSBDb2xsaW5z?= | last post by:
I have a listview that when I select an item, it populates a details view. I want to show the item that was selected in the listview by changing it to yellow. Trouble is, the selected item does not...
59
by: vishal1082 | last post by:
first, i don't know what could i possibly write for the "question" field... i have a button, and i put a label over it, i did that, and transparency and other things are not a problem for me, the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.