How to run time modify webbrowser location / size

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Boki

    How to run time modify webbrowser location / size

    Hi All,

    When put in a webbowser box into form, there is no adjustable anchor
    for user to adjust size if he/she want.

    I use an external Hscroll for adjustment.

    The problem is I have two webbrowser box inside same form, I need to
    change their location in run time.

    but it can't pass complie:

    webBrowser2.Loc ation.X = webBrowser1.Wid th + 5;


    Thanks.
    Boki.
  • Pavel Minaev

    #2
    Re: How to run time modify webbrowser location / size

    On Aug 6, 11:13 am, Boki <boki.digi...@g mail.comwrote:
    Hi All,
    >
    When put in a webbowser box into form, there is no adjustable anchor
    for user to adjust size if he/she want.
    >
    I use an external Hscroll for adjustment.
    >
    The problem is I have two webbrowser box inside same form, I need to
    change their location in run time.
    >
    but it can't pass complie:
    >
      webBrowser2.Loc ation.X = webBrowser1.Wid th + 5;
    It's not related to the control being a WebBrowser - the above line
    wouldn't compile for any control. This is because Location is of type
    Point, and that type has both X and Y as read-only fields (it's a
    struct, and structs are generally supposed to be immutable). So you
    can't change fields individually, but you can change Location as a
    whole. For example:

    webBrowser2.Loc ation = new Point(webBrowse r1.Width + 5,
    webBrowser2.Loc ation.Y);

    Comment

    • =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?=

      #3
      RE: How to run time modify webbrowser location / size

      I'm not sure what you mean by there not being an anchor to adjust the size.
      It sounds like you could place a splitter panel in the ui, with one
      webbrowser in each splitter panel. They can be docked or anchord, and move
      with the split movement. This panel can be docked to your form, and resize
      appropriately when the form resizes.

      "Boki" wrote:
      Hi All,
      >
      When put in a webbowser box into form, there is no adjustable anchor
      for user to adjust size if he/she want.
      >
      I use an external Hscroll for adjustment.
      >
      The problem is I have two webbrowser box inside same form, I need to
      change their location in run time.
      >
      but it can't pass complie:
      >
      webBrowser2.Loc ation.X = webBrowser1.Wid th + 5;
      >
      >
      Thanks.
      Boki.
      >

      Comment

      • Boki

        #4
        Re: How to run time modify webbrowser location / size

        On Aug 6, 5:54 pm, Pavel Minaev <int...@gmail.c omwrote:
        On Aug 6, 11:13 am, Boki <boki.digi...@g mail.comwrote:
        >
        Hi All,
        >
        When put in a webbowser box into form, there is no adjustable anchor
        for user to adjust size if he/she want.
        >
        I use an external Hscroll for adjustment.
        >
        The problem is I have two webbrowser box inside same form, I need to
        change their location in run time.
        >
        but it can't pass complie:
        >
          webBrowser2.Loc ation.X = webBrowser1.Wid th + 5;
        >
        It's not related to the control being a WebBrowser - the above line
        wouldn't compile for any control. This is because Location is of type
        Point, and that type has both X and Y as read-only fields (it's a
        struct, and structs are generally supposed to be immutable). So you
        can't change fields individually, but you can change Location as a
        whole. For example:
        >
          webBrowser2.Loc ation = new Point(webBrowse r1.Width + 5,
        webBrowser2.Loc ation.Y);
        You provided what I need, thank you!

        Boki.

        Comment

        Working...