473,748 Members | 6,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2421
Hello,

Create a MouseMove event on the listview in question,

Inside this event place the following code:

Dim SelectedItem As ListViewItem = lvwFiles.GetIte mAt(e.X, e.Y)
If Not SelectedItem Is Nothing Then
MyLabel.Text = SelectedItem.Te xt
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****@h eadfirst.co.uk
-

"amber" <an*******@disc ussions.microso ft.com> wrote in message
news:B1******** *************** ***********@mic rosoft.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.GetIte mAt(e.X, e.Y)
If Not SelectedItem Is Nothing Then
MyLabel.Text = SelectedItem.Te xt
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****@h eadfirst.co.uk
-

"amber" <an*******@disc ussions.microso ft.com> wrote in message
news:B1******** *************** ***********@mic rosoft.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
25465
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 sort columns based on the column header the user has clicked in both Ascending and Descending formats.
0
2316
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
4513
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 is that when clicking on the "Show details" button the ListView for the appropriate row binds in the codebehind and displays the detail data for the selected row. I did something similar with a gridview control previously, but want to be able to...
0
5997
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 show as yellow until I've clicked the same item two times. What am I doing wrong on the selected item that keeps it from changing to yellow until the item is clicked two times? Also, I have to set the listviews selectedIndex in the...
59
8083
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 problem is, when i take mouse over the label, the button no more has the "effect" which comes when mouse is over it (blue colored in vista/7) so what i wanna do is, somehow make button think the mouse is over it when the mouse is actually over the...
0
8987
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9366
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9241
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8239
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.