Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
mrt mrt is offline
external usenet poster
 
Posts: 70
Default Detecting scrolling in listboxes

Hi There,

I want to synchronize two listboxes (I mean having the same topindex for
both) on the same form, and unfortunatelly I cannot find any event related to
the scrolling, and the other control events are ineffective when the mouse is
overthe scrollbar.

Has anyone met that problem and found a solution?

Thanks,

MrT

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Detecting scrolling in listboxes

Hello,
I understand that are looking for a scroll related event but would you mind
saying a bit more of what you want to do or even post an example of code.

Chas

"MrT" wrote:

Hi There,

I want to synchronize two listboxes (I mean having the same topindex for
both) on the same form, and unfortunatelly I cannot find any event related to
the scrolling, and the other control events are ineffective when the mouse is
overthe scrollbar.

Has anyone met that problem and found a solution?

Thanks,

MrT

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Detecting scrolling in listboxes

As the list box does not expose the Scroll event, the only way would be to
subclass the control and intercept that message. It appears to be class
called "F3 Server 03a80000".
I find Excel does not act well with subclassing, so unless you really need
to go in that direction, change you approach.

Can you not react to the ListBox_Change events ?
Otherwise you can fake it with you own scroll bar on frame over the right
edge of the list box.
Then do what you need in the scroll bar's Scroll/Change event.

NickHK

"MrT" wrote in message
...
Hi There,

I want to synchronize two listboxes (I mean having the same topindex for
both) on the same form, and unfortunatelly I cannot find any event related

to
the scrolling, and the other control events are ineffective when the mouse

is
overthe scrollbar.

Has anyone met that problem and found a solution?

Thanks,

MrT



  #4   Report Post  
Posted to microsoft.public.excel.programming
mrt mrt is offline
external usenet poster
 
Posts: 70
Default Detecting scrolling in listboxes

Can you not react to the ListBox_Change events ?

No, none of the event reacts when you scroll down, as amazing as it might
seem. Event the Enter event does not react when you enter via the scroll bar.
It looks like the scrollbar is anothercontrol separate from the listbox.

Then do what you need in the scroll bar's Scroll/Change event.


That's what I've done so far, but it is quite complex to adapt the scrollbar
to the listbox.

MrT

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Detecting scrolling in listboxes

You are talking about a combo box, not a list box ?
If a combo box, then yes, the list part is a separate control to the edit
part ; the combo box combines them.

What are trying to achieve ?

NickHK

"MrT" wrote in message
...
Can you not react to the ListBox_Change events ?


No, none of the event reacts when you scroll down, as amazing as it might
seem. Event the Enter event does not react when you enter via the scroll

bar.
It looks like the scrollbar is anothercontrol separate from the listbox.

Then do what you need in the scroll bar's Scroll/Change event.


That's what I've done so far, but it is quite complex to adapt the

scrollbar
to the listbox.

MrT





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Detecting scrolling in listboxes

I mean "react to the ListBox_Change event when the user has selected their
choice"

NickHK

"MrT" wrote in message
...
Can you not react to the ListBox_Change events ?


No, none of the event reacts when you scroll down, as amazing as it might
seem. Event the Enter event does not react when you enter via the scroll

bar.
It looks like the scrollbar is anothercontrol separate from the listbox.

Then do what you need in the scroll bar's Scroll/Change event.


That's what I've done so far, but it is quite complex to adapt the

scrollbar
to the listbox.

MrT



  #7   Report Post  
Posted to microsoft.public.excel.programming
mrt mrt is offline
external usenet poster
 
Posts: 70
Default Detecting scrolling in listboxes

Nick,

Just have a try. Create a ListBox in a form, enter enough rows via the List
method so that you have a vertical scrollbar. Then try to detect when you
scroll. I can't.

MrT

"NickHK" wrote:

I mean "react to the ListBox_Change event when the user has selected their
choice"

NickHK

"MrT" wrote in message
...
Can you not react to the ListBox_Change events ?


No, none of the event reacts when you scroll down, as amazing as it might
seem. Event the Enter event does not react when you enter via the scroll

bar.
It looks like the scrollbar is anothercontrol separate from the listbox.

Then do what you need in the scroll bar's Scroll/Change event.


That's what I've done so far, but it is quite complex to adapt the

scrollbar
to the listbox.

MrT




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Detecting scrolling in listboxes

I know you don't get the Scroll event .
My question was why do you need to ?

NickHK

"MrT" wrote in message
...
Nick,

Just have a try. Create a ListBox in a form, enter enough rows via the

List
method so that you have a vertical scrollbar. Then try to detect when you
scroll. I can't.

MrT

"NickHK" wrote:

I mean "react to the ListBox_Change event when the user has selected

their
choice"

NickHK

"MrT" wrote in message
...
Can you not react to the ListBox_Change events ?

No, none of the event reacts when you scroll down, as amazing as it

might
seem. Event the Enter event does not react when you enter via the

scroll
bar.
It looks like the scrollbar is anothercontrol separate from the

listbox.

Then do what you need in the scroll bar's Scroll/Change event.

That's what I've done so far, but it is quite complex to adapt the

scrollbar
to the listbox.

MrT






  #9   Report Post  
Posted to microsoft.public.excel.programming
mrt mrt is offline
external usenet poster
 
Posts: 70
Default Detecting scrolling in listboxes

I know you don't get the Scroll event .
My question was why do you need to ?


Because I want to change the TopIndex of another listboxin the same form so
that they are synchronized.

MrT



"MrT" wrote in message
...
Nick,

Just have a try. Create a ListBox in a form, enter enough rows via the

List
method so that you have a vertical scrollbar. Then try to detect when you
scroll. I can't.

MrT

"NickHK" wrote:

I mean "react to the ListBox_Change event when the user has selected

their
choice"

NickHK

"MrT" wrote in message
...
Can you not react to the ListBox_Change events ?

No, none of the event reacts when you scroll down, as amazing as it

might
seem. Event the Enter event does not react when you enter via the

scroll
bar.
It looks like the scrollbar is anothercontrol separate from the

listbox.

Then do what you need in the scroll bar's Scroll/Change event.

That's what I've done so far, but it is quite complex to adapt the
scrollbar
to the listbox.

MrT







  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Detecting scrolling in listboxes

With ListBox1 in a frame and pushed to the right to hide it's scroll bar and
Scrollbar1 aligned to fake its scroll bar :

Private Sub ListBox1_Change()
ListBox2.TopIndex = ListBox1.TopIndex
ScrollBar1.Value = ListBox1.TopIndex
End Sub

Private Sub ListBox1_Click()
ListBox2.TopIndex = ListBox1.TopIndex
ScrollBar1.Value = ListBox1.TopIndex
End Sub

Private Sub ScrollBar1_Change()
ListBox1.TopIndex = ScrollBar1.Value
ListBox2.TopIndex = ListBox1.TopIndex
End Sub

Private Sub ScrollBar1_Scroll()
ListBox1.TopIndex = ScrollBar1.Value
ListBox2.TopIndex = ListBox1.TopIndex
End Sub

Private Sub UserForm_Initialize()
Dim i As Long

For i = 1 To 25
ListBox1.AddItem "Item " & i
ListBox2.AddItem "Item " & i
Next

With ScrollBar1
.Min = 0
.Max = ListBox1.ListCount - 1
End With

End Sub

NickHK

"MrT" wrote in message
...
I know you don't get the Scroll event .
My question was why do you need to ?


Because I want to change the TopIndex of another listboxin the same form

so
that they are synchronized.

MrT



"MrT" wrote in message
...
Nick,

Just have a try. Create a ListBox in a form, enter enough rows via the

List
method so that you have a vertical scrollbar. Then try to detect when

you
scroll. I can't.

MrT

"NickHK" wrote:

I mean "react to the ListBox_Change event when the user has selected

their
choice"

NickHK

"MrT" wrote in message
...
Can you not react to the ListBox_Change events ?

No, none of the event reacts when you scroll down, as amazing as

it
might
seem. Event the Enter event does not react when you enter via the

scroll
bar.
It looks like the scrollbar is anothercontrol separate from the

listbox.

Then do what you need in the scroll bar's Scroll/Change event.

That's what I've done so far, but it is quite complex to adapt the
scrollbar
to the listbox.

MrT











  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Detecting scrolling in listboxes

Maybe you could build your own listbox using textboxes and scrollbars???

Or maybe you can find a different control (google???) that you can purchase(?),
use, and distribute???

Or maybe you could use a multicolumn listbox so you don't need to use a second
listbox?

MrT wrote:

I know you don't get the Scroll event .
My question was why do you need to ?


Because I want to change the TopIndex of another listboxin the same form so
that they are synchronized.

MrT


"MrT" wrote in message
...
Nick,

Just have a try. Create a ListBox in a form, enter enough rows via the

List
method so that you have a vertical scrollbar. Then try to detect when you
scroll. I can't.

MrT

"NickHK" wrote:

I mean "react to the ListBox_Change event when the user has selected

their
choice"

NickHK

"MrT" wrote in message
...
Can you not react to the ListBox_Change events ?

No, none of the event reacts when you scroll down, as amazing as it

might
seem. Event the Enter event does not react when you enter via the

scroll
bar.
It looks like the scrollbar is anothercontrol separate from the

listbox.

Then do what you need in the scroll bar's Scroll/Change event.

That's what I've done so far, but it is quite complex to adapt the
scrollbar
to the listbox.

MrT








--

Dave Peterson
  #12   Report Post  
Posted to microsoft.public.excel.programming
mrt mrt is offline
external usenet poster
 
Posts: 70
Default Detecting scrolling in listboxes

Dave,

Thanks for your reply. I used another solution that is intermediate, and
fine although not totally satisfactory. The listboxes are only synchronized
when the user moves the mouse over one of the two listboxes.

Maybe you could build your own listbox using textboxes and scrollbars???


Sure, but that's heavy, and I wonder why the developers of Excel did not
create an event related to scrolling in listboxes and textboxes.

Or maybe you can find a different control (google???) that you can purchase(?),
use, and distribute???


I didn't know that controls from third parties are available. Do you know
some?

Or maybe you could use a multicolumn listbox so you don't need to use a second
listbox?


I'm using 2 listboxes, because I want to have 2 checkboxes for each item
(one listbox is overlapping on the other).

Cheers,

MrT



  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Detecting scrolling in listboxes

There are many aspects that could have been exposed at all levels for
controls, components and applications compared to what is actually happening
in Windows.
It's up to you to deal with those limitations or expand on them yourself.

Yes, you can use (most) ActiveX controls.

As a quick example, I've made a custom control that exposes the Scroll event
with an .Add method and Let/Get .TopIndex property. That's all at the
moment.
Let me know your email and I'll send it to you, to see if it really does
make that much difference .

NickHK


"MrT" wrote in message
...
Dave,

Thanks for your reply. I used another solution that is intermediate, and
fine although not totally satisfactory. The listboxes are only

synchronized
when the user moves the mouse over one of the two listboxes.

Maybe you could build your own listbox using textboxes and scrollbars???


Sure, but that's heavy, and I wonder why the developers of Excel did not
create an event related to scrolling in listboxes and textboxes.

Or maybe you can find a different control (google???) that you can

purchase(?),
use, and distribute???


I didn't know that controls from third parties are available. Do you know
some?

Or maybe you could use a multicolumn listbox so you don't need to use a

second
listbox?


I'm using 2 listboxes, because I want to have 2 checkboxes for each item
(one listbox is overlapping on the other).

Cheers,

MrT





  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Detecting scrolling in listboxes

I wouldn't do any of that build from scratch stuff!

The only one I know of is from Nick! And I found out about it today.


MrT wrote:

Dave,

Thanks for your reply. I used another solution that is intermediate, and
fine although not totally satisfactory. The listboxes are only synchronized
when the user moves the mouse over one of the two listboxes.

Maybe you could build your own listbox using textboxes and scrollbars???


Sure, but that's heavy, and I wonder why the developers of Excel did not
create an event related to scrolling in listboxes and textboxes.

Or maybe you can find a different control (google???) that you can purchase(?),
use, and distribute???


I didn't know that controls from third parties are available. Do you know
some?

Or maybe you could use a multicolumn listbox so you don't need to use a second
listbox?


I'm using 2 listboxes, because I want to have 2 checkboxes for each item
(one listbox is overlapping on the other).

Cheers,

MrT


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel- smooth scrolling (instead of 'snap' scrolling) scooterbaga Setting up and Configuration of Excel 2 April 24th 08 02:16 PM
Vertical scrolling...jumps rather than smooth scrolling Miller Man Excel Discussion (Misc queries) 2 January 23rd 07 07:11 PM
Live Scrolling/Real-Time /Smooth Scrolling doesn't work for me in Excel, even 2007 beta [email protected] Excel Discussion (Misc queries) 2 July 21st 06 01:21 AM
Live Scrolling/Real-Time /Smooth Scrolling doesn't work for me in Excel 2003 [email protected] Excel Discussion (Misc queries) 0 May 12th 06 03:15 AM
Demo of Wheelmouse Scrolling Listboxes Robin Hammond Excel Programming 0 July 16th 03 03:17 AM


All times are GMT +1. The time now is 06:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"