ReSize Controls

gray

Registered User.
Local time
Today, 17:03
Joined
Mar 19, 2007
Messages
578
Hi

Access 2007 .mdb
WinXpPro Sp3

I'm trying to permit user-resizing of a treeview control and adjoining listview.. I want the cursor to change to a N-W or N-S pointer when moving near the border of the treeview and to switch to normal when leaving it.

I've cracked the first part by :-
Code:
Private Sub tvTreeView_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
    Dim Posn As Integer
    
    If Allow_Expand_Evnt = False Then
        Exit Sub
    End If

    Posn = x
    
    If Posn > (Me.tvTreeView.Width - 500) And Posn < (Me.tvTreeView.Width) Then
        Screen.MousePointer = 9
    Else
        Screen.MousePointer = 1
    End If
    
End Sub

BUt which event fires when the mouse leaves the control (and the control has not actually been focussed upon) please? The -500 is to cater for when scroll bars appear on the treeview.

I put similar mousemoves in adjoining controls which switched the cursor back to normal but that seems a bit of a bodge to me?

Essentially, I'm trying to re-create what happens in Windows Explorer

Thanks
 
Have you had a look at the On Mouse Move event, that fires when the mouse moves over a control.
 
Hi

Thanks....

Yes, I gather that's the Access equivalent of MouseOver . i popped some code into that which initially changes the cursor (as above) but it does not seem to fire as one leaves the control? LostFocus will fire but only if the control has been clicked in....
 

Users who are viewing this thread

Back
Top Bottom