Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Repositioning Scrollbars in Listbox

Author  Topic 

Sarakumar
Posting Yak Master

108 Posts

Posted - 2006-05-03 : 03:16:21
Hai,
i have a listbox in C# windows forms.in that list box i have say 20 items.im browsing thro the items.Suddenly the page get refereshed.
after that, i need to get the listbox's scrollbars back to same position where it was earlier..Remeber i didnt select any item in the list box...i was just browsing..Say i was browsing at the 10th item means, after refersh i need to get the scroll position near the same 10 item..
is it possible to do???if so, how can we do...

twhelan1
Yak Posting Veteran

71 Posts

Posted - 2006-05-03 : 10:42:01
Why would the form be refreshed in the middle of your scrolling? Sounds like poor (and annoying) UI design.

A quick search on google turned up this article on CodeProject:
http://www.thecodeproject.com/cs/combobox/ScrollingListbox.asp

I didn't read in depth, but it doesn't look like they show you how to set the scroll position, but they do show how to capture it. You should be able to take that code and expand it to do what you want. You'll have to capture the scroll position and store it in a variable, then use that to restore the scroll position on load of your listbox.


~Travis
Go to Top of Page

Sarakumar
Posting Yak Master

108 Posts

Posted - 2006-05-03 : 21:50:53
Hai it is the Requirement to referesh the window. it is something smilar to call center Application. Operator needs to get the users who are all coming online. So every 3 mins i need to refersh it and get the New users if they are any..i will go thro the below link.
Thanks
quote:
Originally posted by twhelan1

Why would the form be refreshed in the middle of your scrolling? Sounds like poor (and annoying) UI design.

A quick search on google turned up this article on CodeProject:
http://www.thecodeproject.com/cs/combobox/ScrollingListbox.asp

I didn't read in depth, but it doesn't look like they show you how to set the scroll position, but they do show how to capture it. You should be able to take that code and expand it to do what you want. You'll have to capture the scroll position and store it in a variable, then use that to restore the scroll position on load of your listbox.


~Travis

Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-05-16 : 04:07:06
you can have a text file created to save your cursor position on the client's machine

HTH

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -