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. Positioning controls on n Physical Screens [modified]

Positioning controls on n Physical Screens [modified]

Scheduled Pinned Locked Moved C#
questionhelptutorialworkspace
3 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.
  • T Offline
    T Offline
    TCHamilton
    wrote on last edited by
    #1

    On a multiple monitor workspace,used as a disco ball I have a scrolling display. The scrolling data is complex so I need to show a 'legend' on each physical monitor. The scrolling display (WebBrowser with Marquee) is stretched across the VirtualScreen that is composed of 3 or more physical monitors. Problem How do I dynamically create a picturebox at runtime? Each picture box will contain an image (.png). How do I place a common image on each physical monitor. I can calculate the position to put the image but am having trouble figuring out how to get the Picturebox to instantiate at run time TIA -- modified at 16:23 Tuesday 23rd January, 2007 -- modified at 16:41 Tuesday 23rd January, 2007

    Tom Hamilton

    L 1 Reply Last reply
    0
    • T TCHamilton

      On a multiple monitor workspace,used as a disco ball I have a scrolling display. The scrolling data is complex so I need to show a 'legend' on each physical monitor. The scrolling display (WebBrowser with Marquee) is stretched across the VirtualScreen that is composed of 3 or more physical monitors. Problem How do I dynamically create a picturebox at runtime? Each picture box will contain an image (.png). How do I place a common image on each physical monitor. I can calculate the position to put the image but am having trouble figuring out how to get the Picturebox to instantiate at run time TIA -- modified at 16:23 Tuesday 23rd January, 2007 -- modified at 16:41 Tuesday 23rd January, 2007

      Tom Hamilton

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      You can add or remove a Control to a Form programmatically whenever you want; it basically requires the same kind of code that the Visual Designer creates when you interactively add a Control. So you could do:

      void myButton_Click(object sender, EventArgs e) {
      Label label=new Label();
      label.Text="my button got clicked";
      label.Location=new Point(x, y);
      y+=30;
      this.Controls.Add(label);
      }

      The main problem with this kind of code is in positioning the new Controls; in the example, you need some initial x,y values, and each new Control will be positioned below the previous one. In the end they are bound to fall of the form... :)

      Luc Pattyn

      T 1 Reply Last reply
      0
      • L Luc Pattyn

        You can add or remove a Control to a Form programmatically whenever you want; it basically requires the same kind of code that the Visual Designer creates when you interactively add a Control. So you could do:

        void myButton_Click(object sender, EventArgs e) {
        Label label=new Label();
        label.Text="my button got clicked";
        label.Location=new Point(x, y);
        y+=30;
        this.Controls.Add(label);
        }

        The main problem with this kind of code is in positioning the new Controls; in the example, you need some initial x,y values, and each new Control will be positioned below the previous one. In the end they are bound to fall of the form... :)

        Luc Pattyn

        T Offline
        T Offline
        TCHamilton
        wrote on last edited by
        #3

        Thank you Luc. By setting the Drawing point I can control the location of the control.

        Tom Hamilton

        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