PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Prevent dragging from webbrowser-VBForums
Results 1 to 4 of 4

Thread: Prevent dragging from webbrowser

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    160

    Prevent dragging from webbrowser

    Hi,
    I am using a webbrowser control to display a page, and I'm looking for a way to prevent the user from being able to drag a link/picture etc. from the webbrowser control to somewhere else (eg. desktop).

    I searched through the forum and Kzin asked a similar question back in 2002, but didn't get an answer.

    Anyone got any ideas?

    Cheers,
    Nap

  2. #2
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Prevent dragging from webbrowser

    Easy one

    add a reference to the Microsoft HTML Object Library

    VB Code:
    1. Dim WithEvents HTML As HTMLDocument
    2.  
    3. Private Sub Form_Load()
    4.     WebBrowser1.Navigate "http://www.google.com"
    5. End Sub
    6.  
    7. Private Function HTML_ondragstart() As Boolean
    8.     HTML_ondragstart = False
    9. End Function
    10.  
    11.  
    12. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    13.     If (pDisp Is WebBrowser1.Application) Then
    14.         Set HTML = WebBrowser1.Document
    15.     End If
    16. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    160

    Re: Prevent dragging from webbrowser

    Static,

    As you said, easy.
    Thnx.

    Cheers,
    Nap

  4. #4
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Prevent dragging from webbrowser

    lol
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width