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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. load user predefined control at runtime created form

load user predefined control at runtime created form

Scheduled Pinned Locked Moved C#
designhelp
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.
  • R Offline
    R Offline
    redspiderke
    wrote on last edited by
    #1

    I have a predefined user control designed at design time, and want it to load a form at runtime it seems simple but i can't get it to work pls help

    A 1 Reply Last reply
    0
    • R redspiderke

      I have a predefined user control designed at design time, and want it to load a form at runtime it seems simple but i can't get it to work pls help

      A Offline
      A Offline
      Anthony Mushrow
      wrote on last edited by
      #2

      Don't you just make an instance of the control and the add it to the form, like so:

      MyCtrl control = new MyCtrl();
      control.ClientSize = new Size(100,25);
      control.Location = new Point(3,3);
      ...

      myMainForm.Controls.Add(control);

      My current favourite word is: I'm starting to run out of fav. words!

      -SK Genius

      Game Programming articles start -here[^]-

      R 1 Reply Last reply
      0
      • A Anthony Mushrow

        Don't you just make an instance of the control and the add it to the form, like so:

        MyCtrl control = new MyCtrl();
        control.ClientSize = new Size(100,25);
        control.Location = new Point(3,3);
        ...

        myMainForm.Controls.Add(control);

        My current favourite word is: I'm starting to run out of fav. words!

        -SK Genius

        Game Programming articles start -here[^]-

        R Offline
        R Offline
        redspiderke
        wrote on last edited by
        #3

        Yes thanks!!! I used the same way but made an error in the namespace

        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