Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    [VB]disabilitare il mouse

    Come posso disabilitare il mouse mediante VB
    Grazie:bubu:

  2. #2
    Utente bannato
    Registrato dal
    Mar 2002
    Messaggi
    1,811

    no mispiace

    ma se vuoi ho questa funzione che lo intrappola nel form
    provala
    codice:
    Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
    End Type
    Declare Function ClipCursor Lib "user32" _
        (lpRect As Any) As Long
    Public Function LetMouseGo(Frm2LetMouseGo As Object)
        Dim erg As Long
        Dim NewRect As RECT
        With NewRect
            .Left = 0&
            .Top = 0&
            .Right = Screen.Width / Screen.TwipsPerPixelX
            .Bottom = Screen.Height / Screen.TwipsPerPixelY
        End With
        erg& = ClipCursor(NewRect)
        ' Assicuratevi di inserire questo codice
        '  Private Sub Form_Unload(Cancel As Integer)
        '    LetMouseGo Me
        '  End Sub
    End Function
    
    Public Function TrapMouse(Frm2MouseTrap As Object)
        Dim x As Long, y As Long, erg As Long
        Dim NewRect As RECT
        x& = Screen.TwipsPerPixelX
        y& = Screen.TwipsPerPixelY
        With NewRect
            .Left = Frm2MouseTrap.Left / x&
            .Top = Frm2MouseTrap.Top / y&
            .Right = .Left + Frm2MouseTrap.Width / x&
            .Bottom = .Top + Frm2MouseTrap.Height / y&
        End With
        erg& = ClipCursor(NewRect)
    End Function

  3. #3

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.