473,405 Members | 2,373 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,405 software developers and data experts.

last item in a listview

Hi,

This should be straight fwd , but I cant seem to do it , all I want to do is
programatically select the last item in a listview, so its always displayed

example :

my listview can display 3 items with out scrolling - after 3 items have been
added you dont see the new items being added, as they are out of focus for
the listview.

I tried

lstvItems.Items(lstvItems.Items.Count - 1).Focused = True

lstvItems.Items(lstvItems.Items.Count - 1).Selected = True

Any ideas ?

Jon
Nov 21 '05 #1
2 7874
Joh,

lstvItems.EnsureVisible (lstvItems.Items.Count - 1)

Kerry Moorman
"Jon Vaughan" wrote:
Hi,

This should be straight fwd , but I cant seem to do it , all I want to do is
programatically select the last item in a listview, so its always displayed

example :

my listview can display 3 items with out scrolling - after 3 items have been
added you dont see the new items being added, as they are out of focus for
the listview.

I tried

lstvItems.Items(lstvItems.Items.Count - 1).Focused = True

lstvItems.Items(lstvItems.Items.Count - 1).Selected = True

Any ideas ?

Jon

Nov 21 '05 #2
Thanks - worked great

"Kerry Moorman" <Ke**********@discussions.microsoft.com> wrote in message
news:62**********************************@microsof t.com...
Joh,

lstvItems.EnsureVisible (lstvItems.Items.Count - 1)

Kerry Moorman
"Jon Vaughan" wrote:
Hi,

This should be straight fwd , but I cant seem to do it , all I want to do
is
programatically select the last item in a listview, so its always
displayed

example :

my listview can display 3 items with out scrolling - after 3 items have
been
added you dont see the new items being added, as they are out of focus
for
the listview.

I tried

lstvItems.Items(lstvItems.Items.Count - 1).Focused = True

lstvItems.Items(lstvItems.Items.Count - 1).Selected = True

Any ideas ?

Jon

Nov 21 '05 #3

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

Similar topics

0
by: Mathias Soeken | last post by:
Hallo, in a ListView (Details View) the scrollbar appears, if there a more items than space. if you scroll the vertical scrollbar down, you can see the last item in the last col of the ListView....
5
by: GG | last post by:
I know I can scroll to the last item in the listbox by calling SetSelected all the time What I need is when I add items through the Items.Add or Items.AddRange to be called automatically and go...
11
by: Crirus | last post by:
Easyest and fastest way... :) -- Ceers, Crirus ------------------------------ If work were a good thing, the boss would take it all from you ------------------------------
1
by: David | last post by:
Would someone mind explaining how I can get a listview to scroll down and show the last item. I am creating a history log that receives records from the serial port and I need the most recent...
1
by: Christof Nordiek | last post by:
Hi, in my app i use a treeview. If the treeview isn't large enough to show all items it automoatically gets a vertical scrollbar. But i can't always scroll to the last item. Sometimes the last...
5
by: Nick Valeontis | last post by:
Is there a way to get the last item added to a generic list? That is, without using the count property. Something to improve this code: schedule.jobs.tasks.Add( ... );
0
by: inandout | last post by:
Hi, I was wondering if anyone can help me with this. I have a listview that is specified to a size of: 348W x 308H When items are added to it, no problems. However when items continue to be...
15
by: Igal | last post by:
hay, i have this werid problem with my book adding function, this how it looks book* AddBook(book *bp, unsigned *size) { .... //then i use realloc to allocate space for the new item in the bp...
5
by: Curious | last post by:
I have an ArrayList outputList. I only need to get the last item: int last = outputList.LastIndexOf(null); ExtremeBucket lastItem = (ExtremeBucket)outputList; Please confirm if this is the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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...

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.