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)
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.