Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Visual Studio 2008 Web Browser Control

Visual Studio 2008 Web Browser Control

Scheduled Pinned Locked Moved Visual Basic
helpquestioncsharpjavavisual-studio
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AndyASPVB
    wrote on last edited by
    #1

    Hi I am not sure whether this is the right forum to ask this question, but I am using the web browser control in Visual Studio 2008 to create my own browser. Firstly, dragging the control onto a form, and run it I can access all of my web pages, so no problem there, but I have a few questions that I need to find answers to: 1) As the web browser control is an instance of IE, then if Java Script is disabled in Internet Explorer, would it be disabled in my browser? If not, is there a way of ensuring programmatically disable it in my explorer as this is what I want? Likewise, I would like to ensure that Active X is enabled in my browser? 2) My second question is that my web application will not have an address because I want to hide this away for security reasons. Rather re-create my web browser to change the URL if the web pages move to a different server, is there away I can use an INI or some text file which will hold this information if such a thing were to happen - can someone help me on this? 3) I have used IsWebBrowserContextMenuEnabled = False to switch off right clicks in the browser - is there away to switch off key press commands, such as ctrl P, print screen in a bespoke web browser? I hope some one can help! Thanks

    C A 2 Replies Last reply
    0
    • A AndyASPVB

      Hi I am not sure whether this is the right forum to ask this question, but I am using the web browser control in Visual Studio 2008 to create my own browser. Firstly, dragging the control onto a form, and run it I can access all of my web pages, so no problem there, but I have a few questions that I need to find answers to: 1) As the web browser control is an instance of IE, then if Java Script is disabled in Internet Explorer, would it be disabled in my browser? If not, is there a way of ensuring programmatically disable it in my explorer as this is what I want? Likewise, I would like to ensure that Active X is enabled in my browser? 2) My second question is that my web application will not have an address because I want to hide this away for security reasons. Rather re-create my web browser to change the URL if the web pages move to a different server, is there away I can use an INI or some text file which will hold this information if such a thing were to happen - can someone help me on this? 3) I have used IsWebBrowserContextMenuEnabled = False to switch off right clicks in the browser - is there away to switch off key press commands, such as ctrl P, print screen in a bespoke web browser? I hope some one can help! Thanks

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      1 - yes, I believe the IE settings on the host machine will apply 2 - You cannot have a web application without an address. How is this related to your 'browser' ? Yes, if you want your 'browser' to open your site, you can simply hide the URL, and browse to it, and you can store it in a config file. 3 - No, I don't believe so, although I know you can handle keypress events, perhaps you can mark them as handled if control is down ?

      Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )

      1 Reply Last reply
      0
      • A AndyASPVB

        Hi I am not sure whether this is the right forum to ask this question, but I am using the web browser control in Visual Studio 2008 to create my own browser. Firstly, dragging the control onto a form, and run it I can access all of my web pages, so no problem there, but I have a few questions that I need to find answers to: 1) As the web browser control is an instance of IE, then if Java Script is disabled in Internet Explorer, would it be disabled in my browser? If not, is there a way of ensuring programmatically disable it in my explorer as this is what I want? Likewise, I would like to ensure that Active X is enabled in my browser? 2) My second question is that my web application will not have an address because I want to hide this away for security reasons. Rather re-create my web browser to change the URL if the web pages move to a different server, is there away I can use an INI or some text file which will hold this information if such a thing were to happen - can someone help me on this? 3) I have used IsWebBrowserContextMenuEnabled = False to switch off right clicks in the browser - is there away to switch off key press commands, such as ctrl P, print screen in a bespoke web browser? I hope some one can help! Thanks

        A Offline
        A Offline
        Andy Missico
        wrote on last edited by
        #3
        1. This is a security issue that is not supported by the web browser control. Imagine the security risk if someone could change settings for each of the different security zones. To disable scripting, I strip the script from the page. (An exercise left to the reader.) 2) My.Settings is perfect for what you want to do. Bring up the properties for the web browser control, select (ApplicationSettings) then (PropertyBinding), scroll down to Url, expand the drop-down list, then select "new..." The rest is up to you. 3) Use WebBrowserShortcutsEnabled property. Check the documentation for this property, specifically the Remarks and Example sections. Following is my standard initialization for a "concealed" web browser control. Private Sub InitializeBrowserHelper() _browseHelper = New System.Windows.Forms.WebBrowser _browseHelper.AllowWebBrowserDrop = False _browseHelper.IsWebBrowserContextMenuEnabled = False _browseHelper.WebBrowserShortcutsEnabled = False _browseHelper.ScriptErrorsSuppressed = True AddHandler _browseHelper.DocumentCompleted, AddressOf _browseHelper_DocumentCompleted End Sub
        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups