473,487 Members | 2,461 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Selecting a List View Item

I can't figure out what I'm missing here. I set up a list
view control. As I load the form, I select one of the
items in the list view control:

lvwPrograms.Items(0).Selected = True

Everything is handled properly except that the item did
not highlight in the listview control. Do I need to
programatically highlight the item? If so how do I do
this?

Thanks
Brent

Nov 20 '05 #1
3 1197
Brent,

You should also use the EnsureVisible method of the ListViewItem. You may
need to move the code to the Activate Event if you are loading the form with
data before you show it.

Dan
"Brent Hoskisson" <br************@colliergov.net> wrote in message
news:08****************************@phx.gbl...
I can't figure out what I'm missing here. I set up a list
view control. As I load the form, I select one of the
items in the list view control:

lvwPrograms.Items(0).Selected = True

Everything is handled properly except that the item did
not highlight in the listview control. Do I need to
programatically highlight the item? If so how do I do
this?

Thanks
Brent

Nov 20 '05 #2
Cor
Hi Brent,

litstview1.HideSelection = False

I hope this helps?

Cor
I can't figure out what I'm missing here. I set up a list
view control. As I load the form, I select one of the
items in the list view control:

lvwPrograms.Items(0).Selected = True

Everything is handled properly except that the item did
not highlight in the listview control. Do I need to
programatically highlight the item? If so how do I do
this?


Nov 20 '05 #3
set the focus to the control first and then select it.

On Mon, 17 Nov 2003 07:08:14 -0800, "Brent Hoskisson"
<br************@colliergov.net> wrote:
I can't figure out what I'm missing here. I set up a list
view control. As I load the form, I select one of the
items in the list view control:

lvwPrograms.Items(0).Selected = True

Everything is handled properly except that the item did
not highlight in the listview control. Do I need to
programatically highlight the item? If so how do I do
this?

Thanks
Brent


Nov 20 '05 #4

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

Similar topics

7
5254
by: Jax | last post by:
I understand that it's supposed to contain text, usually. But as it takes an object can you be really cheeky and put a very complex object in there instead? Would any problems come from doing...
1
2429
by: David | last post by:
hello to all... i've one more question... how to make listview to enter to "label edit" state... -- let say, user of my program click on "rename item" button, and focus sets to list view item, to...
0
1271
by: Al Findlay | last post by:
Hello! I have a listview which has a column of images. The problem is, I want to be able to align the images to the centre of the column. By default, the images always align to the left. Can...
3
3515
by: Brian Henry | last post by:
So what is the easiest way to do this? I have one list view with a list of items (in detail view and with about 20 sub items) and a second list view that will take the items they drag from the...
0
2278
by: Smokey Grindle | last post by:
This is just a wierd one... I am trying to draw the sub items in the drawitem event of the list view in owner drawn mode (because of documented W32 rendering bugs) instead of in two seperate items...
2
4182
by: Alan T | last post by:
I want to align the text in the first column in the list view to the right. However, when I select the 'Right' from the drop down list box in the TextAlign property of the first column it still...
1
10203
by: Jeff | last post by:
I have a list view with items. An item is clicked and I have a form to change this data. How can I update the listview row in the list view control.
1
1360
by: Se0ng | last post by:
hi, I'm new to vb.net and I need some help, I done a backcolor change to my list view item as below code, Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)...
2
5501
by: Mohit | last post by:
Hi all, I am working on a windows application with a list view on a form. Now I wanted to show hand cursor when mouse is over list view item and default(arrow) cursor at other places. List...
0
7142
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
7181
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...
1
6847
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...
0
7352
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...
1
4875
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
4565
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...
0
3078
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...
0
1383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
272
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.