473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

How to Edit my Derived Panel in Visual Designer

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)
Jun 27 '08 #1
3 2958
This may help some:

http://www.codeproject.com/KB/miscct...pertytree.aspx

On May 20, 9:12*pm, "zhaod...@gmail.com" <zhaod...@gmail.comwrote:
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)
Jun 27 '08 #2
On May 21, 12:12 pm, "zhaod...@gmail.com" <zhaod...@gmail.comwrote:
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)
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.
Jun 27 '08 #3
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.
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Skidmore | last post by:
I am building an application that will fade one panel to another panel. Both panels will have picture boxes in them (thumbnails). This is what I have tried: private void...
4
by: Glenn M | last post by:
I have a shared XML file on a server . i also have one xslt file that performs a simple transform on in to view the data. now i want to have another page that lets users modify the shared xml...
4
by: Dennis | last post by:
I am trying to set the default design proerties in a control I have derived from the Panel Class. I thought I'd found how to do it from the MSDN but the following line doesn't work: Inherits...
8
by: tranky | last post by:
i hope you can help me! It's possible create a moveable panel in vb.net? Click with mouse over it and move it everywhere!?!? It's possible? thank u!
7
by: Sharon | last post by:
I’m using the Panel control that contains a PictureBox control (for implementing the http://www.codeproject.com/cs/miscctrl/PictureBox.asp). The Panel is set to AutoScroll = true. I wish to...
2
by: Peter | last post by:
ASP.NET 2003 In the DataGrid how do I select current cell value in the dropdown box when I click on the edit link, currently when I click on the edit link in the DataGrid the dropdown box...
2
by: =?Utf-8?B?Z2FuZQ==?= | last post by:
Hi, In a gridview, How can i display different columns between item and edit modes. For eg. i have a sql that returns productname, categoryname, etc. In viewmode, i need to display only...
1
tlhintoq
by: tlhintoq | last post by:
So I've created my own class SmartForm, derived from Form... public partial class SmartForm : Form It contains methods for things like remembering position, fading in or out, logging and so on. ...
1
by: =?Utf-8?B?Q2hyaXN0aWFuIFdlaW5lcnQ=?= | last post by:
Hello, I currently fight with a problem during the derivative of WinForm controls. In Visual Studio I created a new User Control. This control is derived from the DataGridView of the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.