hey guys,
I have a scrollable UserForm with Frames and Listboxes. Everyime I clicked either of them the scrollbar jumped to the top of the clicked / focused control. I managed to solve this with a small piece of code in UserForm_Scroll sub but it only works for Frames and not Listboxes, they still refocus my position in the userform.
Any idea why? Thanks
I have a scrollable UserForm with Frames and Listboxes. Everyime I clicked either of them the scrollbar jumped to the top of the clicked / focused control. I managed to solve this with a small piece of code in UserForm_Scroll sub but it only works for Frames and not Listboxes, they still refocus my position in the userform.
Any idea why? Thanks
Code:
Private Sub UserForm_Scroll(ByVal ActionX As MSForms.fmScrollAction, ByVal ActionY As MSForms.fmScrollAction, ByVal RequestDx As Single, ByVal RequestDy As Single, ByVal ActualDx As MSForms.ReturnSingle, ByVal ActualDy As MSForms.ReturnSingle) If ActionY = fmScrollActionFocusRequest Then
ActualDy.Value = 0
End If
End Sub