Logo
English Russian German French Spanish Italian
contact usprivacy
   Support Forums
chart
• Adjust flexgrid cell
• Animation
• Centering form text
• Coffee machine
• Creating fileshares
• Creating shortcuts
• Custom buttons
• Directory browser
• Disable mouse events
• File search by ext
• File transfer
• File watcher
• Formatting flexgrid
• Get Content Type
• Get HTML source
• Get modem port
• HTTP proxy
• ipconfig
• Large file split/merge
• MAPI
• MCI Sound Player
• Menu with images
• MP3 normalizer
• Net Send
• Netstat 2000
• No duplicate entries
• Outlook Address Book
• Set font color
• Shapes
• SOAP test
• Text-to-image
• Text file viewer
• Text find/replace
• UPS component
• View NT groups
• Word template
• Writing DNS control
    • Using DNS control
• Writing SMTP control
    • Sending email
    • Mailing list
• Writing WhoIs control
    • Using WhoIs control
• View HTML source
OISV - Organization of Independent Software Vendors - Contributing Member
VB projects - Disable mouse events

Description: Disable mouse events for specified control
Minimum requirements: VB6
Download: source code
Screenshot:
VB projects - Disable mouse events
Project: EXE
Controls: TextBox Text1 (MultiLine = -1 'True, ScrollBars = 2 'Vertical), TextBox Text2 (MultiLine = -1 'True, ScrollBars = 2 'Vertical)
Additional references: none
Code:
Option Explicit

Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If Not ((X > Text1.Left And X < Text1.Left + Text1.Width) And (Y > Text1.Top And Y < Text1.Top + Text1.Height)) Then _ ReleaseCapture End Sub
Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) SetCapture Me.hwnd End Sub

Copyright © 1996-2013 OstroSoft. All rights reserved. info@ostrosoft.com