Creating a Panel from with in a class
-
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
-
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
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 inpublic 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.
-
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
Hi you create a Usercontrol & insert all the panel u need. So that U can use it anywhere without recreating it.