General discussion


Scroll custom event in VB.Net

By jas6062 ·
I am using VB.Net and want to create a custom event. I have two list boxes, of the same size, that when I scroll one of them, I would like the other listbox to scroll too. In VB 6, there was a scoll event. Now in .Net, the SelectedIndexChanged event is the replacement, but requires the user to click inside of the list box. I would like it to change when the user clicks the vertical scroll bar. I believe that a custom event, "ScrollChanged", would be a solution, but I do not know how to create it. Anyone know how to help please respond. Thank you.

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
Thread display: Collapse - | Expand +

All Comments

Collapse -

by bckurd In reply to Scroll custom event in VB ...

Yes .Net doesn't have scrolling event for list boxes. However there is a way to do that. First do not define vertical scrolling for the list boxes for both of them. Add another scrolling object (vertical one) on to your form. You will be able to control the scrolling event for the scrollbar.

Whenever the value of scroll changes, you can carry the index of list box to top. So you will be listing the items in the list box with playing its index in the list. The both list boxes can act same at same time.

I hope that helps!

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums