473,412 Members | 2,027 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,412 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 2400
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
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.