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. C#
  4. Regarding the WebBrowser Class/Control in C#

Regarding the WebBrowser Class/Control in C#

Scheduled Pinned Locked Moved C#
questioncsharpsysadmin
4 Posts 2 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.
  • L Offline
    L Offline
    labdakos
    wrote on last edited by
    #1

    Hi guys! I'm new to network programming so i'm sorry if this question is a little noobish. I started using the WebBrowser Control in c# and so far it has done my purpose. But I want to know if there is a way to utilize this same control (so I won't change my code) without the visual display. Is it possible to "hide" the control but letting it stay active? Or is there a usable base class where the WebBrowser inherits its properties and methods? Thank you guys!

    0 1 Reply Last reply
    0
    • L labdakos

      Hi guys! I'm new to network programming so i'm sorry if this question is a little noobish. I started using the WebBrowser Control in c# and so far it has done my purpose. But I want to know if there is a way to utilize this same control (so I won't change my code) without the visual display. Is it possible to "hide" the control but letting it stay active? Or is there a usable base class where the WebBrowser inherits its properties and methods? Thank you guys!

      0 Offline
      0 Offline
      0x3c0
      wrote on last edited by
      #2

      You could try setting the Visible property to false. You could instantiate it, but not add it to the Controls collection. If you wanted to, you could even use a HttpWebRequest to get a webpage's source

      L 1 Reply Last reply
      0
      • 0 0x3c0

        You could try setting the Visible property to false. You could instantiate it, but not add it to the Controls collection. If you wanted to, you could even use a HttpWebRequest to get a webpage's source

        L Offline
        L Offline
        labdakos
        wrote on last edited by
        #3

        My first intuition was to set the visibility to false, but then it turns out that doing so disables the whole control and thus the rest of my code wont work. What do you mean by "You could instantiate it, but not add it to the Controls collection"? Btw, I tried to instantiate it instead of adding it the control from the designer by the code: webBrowser webBrowser1 = new webBrowser(); However, it didn't work in this manner. I also can't seem to find a property that would let it not display. I also have a code using HttpWebRequest and HttpWebResponse, but its a lot longer and I don't know how to send multiple posts and how to activate a button click...

        L 1 Reply Last reply
        0
        • L labdakos

          My first intuition was to set the visibility to false, but then it turns out that doing so disables the whole control and thus the rest of my code wont work. What do you mean by "You could instantiate it, but not add it to the Controls collection"? Btw, I tried to instantiate it instead of adding it the control from the designer by the code: webBrowser webBrowser1 = new webBrowser(); However, it didn't work in this manner. I also can't seem to find a property that would let it not display. I also have a code using HttpWebRequest and HttpWebResponse, but its a lot longer and I don't know how to send multiple posts and how to activate a button click...

          L Offline
          L Offline
          labdakos
          wrote on last edited by
          #4

          I got it, there was this code: this.Controls.Add(this.webBrowser1) that adds the control to the windows form, All I had to do is comment it out. Thanks for the help!

          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