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. User Control [modified]

User Control [modified]

Scheduled Pinned Locked Moved C#
question
4 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.
  • F Offline
    F Offline
    fjlv2005
    wrote on last edited by
    #1

    Good day, How can I make a UserControl inherits from a Form? I've tried to do this:

    public partial class UserControl1 : Form
    {
    ..
    }

    But when I add a the dll to my test program, I could not find UserControl1 from the listed control and a message appears indicating the no control exist. Thanks. -- modified at 5:09 Tuesday 27th February, 2007

    L 1 Reply Last reply
    0
    • F fjlv2005

      Good day, How can I make a UserControl inherits from a Form? I've tried to do this:

      public partial class UserControl1 : Form
      {
      ..
      }

      But when I add a the dll to my test program, I could not find UserControl1 from the listed control and a message appears indicating the no control exist. Thanks. -- modified at 5:09 Tuesday 27th February, 2007

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      If you want to use your UserControl1 as a UserControl, then you must inherits it from Class UserControl. You cannot create a new usercontrol inherits from a Form.

      F 1 Reply Last reply
      0
      • L Lost User

        If you want to use your UserControl1 as a UserControl, then you must inherits it from Class UserControl. You cannot create a new usercontrol inherits from a Form.

        F Offline
        F Offline
        fjlv2005
        wrote on last edited by
        #3

        The reasoN why i want to create a usercontrol that is derived from a form because i want to create customable panel, that can be minimize or maximize. i've made a usercontrol which is derived from Panel but the problem is when the backcolor of the control is transparent and that control is placed inside my usercontrolpanel, the transparency goes through all the way to the form, that is why i thought i should derived my usercontrol from a form. Please refer to the image linke below for sample output of my usercontrol: http://www.geocities.com/fritzjeran/SAMPLEOUTPUT.JPG Any suggestion is appreciated. Thanks.

        C 1 Reply Last reply
        0
        • F fjlv2005

          The reasoN why i want to create a usercontrol that is derived from a form because i want to create customable panel, that can be minimize or maximize. i've made a usercontrol which is derived from Panel but the problem is when the backcolor of the control is transparent and that control is placed inside my usercontrolpanel, the transparency goes through all the way to the form, that is why i thought i should derived my usercontrol from a form. Please refer to the image linke below for sample output of my usercontrol: http://www.geocities.com/fritzjeran/SAMPLEOUTPUT.JPG Any suggestion is appreciated. Thanks.

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

          fjlv2005 wrote:

          customable panel, that can be minimize or maximize

          That's easy, you just set the dock style of the control to all, to maximise on the form. Set it to none and the size to 0,0 to minimise.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          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