473,670 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shift Focus on ListBox Items...


I'm sure this is easy but I can't figure it out.

I use a ListBox for my application log and each time the app performs
a task an entry is added into the ListBox.

When the list box becomes full, a vertical scrollbar is automatically
added to the ListBox. As more and more entries are added to the
ListBox it becomes a chore to continually have to manually scroll down
to see the new entry.

How can I force the vertical scrollbar to move along with the
entries? This way my users don't have to keep scrolling down to see
the new entries added to the ListBox?

As far as I can tell I can specify a SelectedItem but I'd have to
specify the Item number and since entries are constantly being added
this is not prudent.
Thanks
T$
Nov 20 '05 #1
3 2828
Why not just use a multi line text box instead and pre-pend the text, this
way last entry is at the top.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Thunder$tr uck" <ts@decss.com > wrote in message
news:89******** *************** *********@4ax.c om...

I'm sure this is easy but I can't figure it out.

I use a ListBox for my application log and each time the app performs
a task an entry is added into the ListBox.

When the list box becomes full, a vertical scrollbar is automatically
added to the ListBox. As more and more entries are added to the
ListBox it becomes a chore to continually have to manually scroll down
to see the new entry.

How can I force the vertical scrollbar to move along with the
entries? This way my users don't have to keep scrolling down to see
the new entries added to the ListBox?

As far as I can tell I can specify a SelectedItem but I'd have to
specify the Item number and since entries are constantly being added
this is not prudent.
Thanks
T$

Nov 20 '05 #2
Well - this may sound a bit retro - but what about doing a quick
P/Invoke and using one of the WM_ scroll messages?

Sriram
--
Sriram Krishnan
Microsoft Student Ambassador
Manager - Chennai .NET Student User Group (www.cnugstudent.net)
I blog at http://www.dotnetjunkies.com/weblog/sriram
Nov 20 '05 #3
switch to a ListView and use the EnsureVisible method?

"Thunder$tr uck" <ts@decss.com > wrote in message
news:89******** *************** *********@4ax.c om...

I'm sure this is easy but I can't figure it out.

I use a ListBox for my application log and each time the app performs
a task an entry is added into the ListBox.

When the list box becomes full, a vertical scrollbar is automatically
added to the ListBox. As more and more entries are added to the
ListBox it becomes a chore to continually have to manually scroll down
to see the new entry.

How can I force the vertical scrollbar to move along with the
entries? This way my users don't have to keep scrolling down to see
the new entries added to the ListBox?

As far as I can tell I can specify a SelectedItem but I'd have to
specify the Item number and since entries are constantly being added
this is not prudent.
Thanks
T$

Nov 20 '05 #4

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

Similar topics

2
5737
by: Matt Sawyer | last post by:
Hi, I'm attempting to do a drag and drop operation from one listbox to another. I have my listboxes setup with SelectionMode = MultiExtended so that I can use the shift key, cntrl key, etc. to make multiple selections. The problem I am having is that when I use the shift key to select a range of items, I first click on one item (item gets highlighted), then, holding down the shift key, I select another item (the range of items gets...
0
5070
by: Miquel | last post by:
Hi all. I felt frustrated when developing an 'UserControl' derivated from textBox, because sequence event (and Validate event) seems to fail. I Always thought my code was wrong. But after trying the UserControl a lot of hours I have the feeling that c# (or .Net) fails. Thus, I have developed a simple program with 3 textBox, 1 Botton and 1 ListBox (for showing results) which fire OnEnter, OnGotFocus,
1
2261
by: yamne | last post by:
I have a problem. When I click in edit datagrid button I show two listbox and two button. I use two button to move data between two listbox. My problem is that I can't call the listbox in the button_click function because the only way to find the listbox is: (listbox)e.item.findcontrol What s the solution to this problem?
4
2950
by: JC | last post by:
Hello- I have a form which has a listbox, a textbox and a submit button. The user types a phone number into the textbox, clicks button, text gets added to the listbox. After this process I need the focus to be back in the textbox. Sounds easy hu? Here's my code- Private Sub cmdAddLine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAddLine.Click
1
2752
by: Crazy Cat | last post by:
Hi, I have a form with a databound listbox and combobox. The listbox items are filtered based on the selection for the combobox. If I click on the listbox to select an item, I can no longer select the combobox or even exit the form. It's as if something won't let me take focus away from the listbox -- all I'm able to do is navigate within the listbox.. There is no error or exception thrown -- I just can't access anything outside of...
2
4075
by: Hitesh | last post by:
I have a listbox and the values get selected (highlighted) from code. I can highlight the corresponding list box items, but they do not show in the listbox I have to scroll through the list box to find them. How can I setFocus on the highlighted data items in the listbox after they are highlighted. The selection mode is set to multiple for the listbox -- Thanks
3
2292
by: Ali Chambers | last post by:
Hi, I have created a listbox called "dtlist1" on my VB.NET form. I call a procedure as follows: Private Sub openfile(flname As String) dtlist1.Items.Clear() etc..
6
16407
by: probashi | last post by:
Hi, Issue: After post back selected item of a list box is getting out of focus (when it contains more items than it's size). I have a List Box in an ASPX page. I select an item from the ListBox and after post back the item is still selected but it is not focused (i.e. I have to scroll down to see the selected item) Any way to fix this!
1
4021
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which are not bound, I select from the bottom set and add to the top set which works fine, but now i decide to remove an item from the top set. when i tried to use a remove item code it worked fine, it did delete the item form the list but it added...
0
8469
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
8386
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
8814
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
8592
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
8661
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...
1
6213
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
4211
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...
1
2800
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 we have to send another system
2
1794
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.