Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / May 2008

Tip: Looking for answers? Try searching our database.

How to Edit my Derived Panel in Visual Designer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zhaodapu@gmail.com - 21 May 2008 03:12 GMT
I derived a panel class:

   public class DeskPanel : System.Windows.Forms.Panel

Now I want to use the visual designer to add controls in MyPanel
class. But I noticed that the visual designer didn't work.

I try some other ways, and found the if i derived my panel from
UserControl class it works. However, I thought deriving from Panel is
more rational. I have several panels (such as calendar panel, contacts
panel, photo viewer... and I will switch them in my main form base on
the user choice)
qglyirnyfgfo@mailinator.com - 21 May 2008 14:31 GMT
This may help some:

http://www.codeproject.com/KB/miscctrl/propertytree.aspx

> I derived a panel class:
>
[quoted text clipped - 8 lines]
> panel, photo viewer... and I will switch them in my main form base on
> the user choice)
.\\axxx - 22 May 2008 00:06 GMT
On May 21, 12:12 pm, "zhaod...@gmail.com" <zhaod...@gmail.com> wrote:
> I derived a panel class:
>
[quoted text clipped - 8 lines]
> panel, photo viewer... and I will switch them in my main form base on
> the user choice)

If you mean that you are trying to add controls to your pane at design
time when your panel hasn't been dropped onto a Form (or other
control) then you can't (to my knowledge). What you need to do is to
create a user control (not a panel) then add your controls onto that
at design time (as you have discovered).
What is is about Panel that you think is more logical than
UserControl? You can have several of them, and switch between them
exactly as you can a panel - in fact the main difference between a
Usercontrol and a panel would seem to be that you can do what you
require with a UserControl and you can't with a Panel!

Of course, if you REALLY want to use Panel, then you need to put that
panel onto something to be able to design it, so you could put it on
your form, add controls to it, make it invisible, add our other
panels, do the same etc.
zhaodapu@gmail.com - 23 May 2008 05:44 GMT
It really helps me to make my decision. Thanks a lot.

I thought use Panel is more logical because I thought a UserControl
should be a general and reusable component. What I need is just a
collection of controls like buttons and textboxs. I did the same thing
when I use Java Swing and Jbuilder. Troubles happen when I study
Csharp with Java in mind.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.