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. Creating a Panel from with in a class

Creating a Panel from with in a class

Scheduled Pinned Locked Moved C#
graphicstutorial
3 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.
  • G Offline
    G Offline
    Gary Strunk
    wrote on last edited by
    #1

    I have a project where I have a lot of panels on my form. It gets to be a hassel moving them front/back to edit them. Is there a way to encase the panel in a class, so I can just make it visible or invisible from class calls and not have to have it cluttering up my form during normal editing. For example, I have a color picker panel which includes a listbox of all the color names and a picture box that I use to display the color and its name (using graphics). I can see where I could use this in several projects and don't want to have to recreate it everytime. Gary Strunk

    L S 2 Replies Last reply
    0
    • G Gary Strunk

      I have a project where I have a lot of panels on my form. It gets to be a hassel moving them front/back to edit them. Is there a way to encase the panel in a class, so I can just make it visible or invisible from class calls and not have to have it cluttering up my form during normal editing. For example, I have a color picker panel which includes a listbox of all the color names and a picture box that I use to display the color and its name (using graphics). I can see where I could use this in several projects and don't want to have to recreate it everytime. Gary Strunk

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

      Hi, you could create a class as in public class MyPanel : Panel {...} by creatind a code file; such Control would, after one build, be available for use by Visual Designer through the Toolbox, without residing in a separate DLL file. or you could create a UserControl in a separate DLL file, as in public class MyPanel : UserControl {...}; that way you can include the same DLL in other projects, and you can set its properties through Visual Designer when including it in say another Form. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


      1 Reply Last reply
      0
      • G Gary Strunk

        I have a project where I have a lot of panels on my form. It gets to be a hassel moving them front/back to edit them. Is there a way to encase the panel in a class, so I can just make it visible or invisible from class calls and not have to have it cluttering up my form during normal editing. For example, I have a color picker panel which includes a listbox of all the color names and a picture box that I use to display the color and its name (using graphics). I can see where I could use this in several projects and don't want to have to recreate it everytime. Gary Strunk

        S Offline
        S Offline
        Satish Pai
        wrote on last edited by
        #3

        Hi you create a Usercontrol & insert all the panel u need. So that U can use it anywhere without recreating it.

        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