473,387 Members | 1,779 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,387 software developers and data experts.

UserControl with a "Container panel" problems

Hi !

I would like to create a UserControl that act as a « Collapsible Panel ».

So I have a UserControl with two panels : a "Header panel" at the top, and a
"Container Area Panel" docked to fill the remaining client area of the
UserControl.

The "Header panel" is for Text, Icon,.

The "Container Area Panel" is to host all the Control dragged from the V.S.
toolbox.

How can I tell the designer that the "Container Area Panel" ONLY should
accept controls (dropped from the toolbox) ?

Actually my "Container Area Panel" has public modifiers.

I tried with that statement just above the declaration of my
CollapsiblePanel Class

[Designer(typeof(CollapsiblePanelDesigner))]

And I have made this class:

public class CollapsiblePanelDesigner : ParentControlDesigner

{

public override void Initialize(System.ComponentModel.IComponent
component)

{

base.Initialize(component);

CollapsiblePanel TmpCollapsiblePanel = component as CollapsiblePanel;

EnableDesignMode(TmpCollapsiblePanel.ClientPanel,
TmpCollapsiblePanel.ClientPanel.Name);
}

}

But this doesn't work .. I can drop controls on my CollapsiblePanel, but
designer allow to drop them also on the "Header Panel" (It shouldn't) . And
the Designer "forget" to add the controls to the "Container Area Panel" at
run time : in the InitializeComponent() the control on the CollapsiblePanel
are never added to the control (this line is missing [not generated]:
this.CollapsiblePanel1.Pan_Container.Controls.Add( Textbox1);)

Does anybody have an idea on what I'm missing ??

Thanks for any help or comments,

Steph.
Jul 20 '06 #1
1 12029
OK, It works now !

I forgot to put the
"[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)]"
statement above the propety that publish the "Container Panel" :

[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)]
public Panel ContainerPanel
{
get
{
return Pan_Container;
}
}//EndProp ContainerPanel


"TheSteph" <Th******@NoSpam.comwrote in message
news:OV**************@TK2MSFTNGP03.phx.gbl...
Hi !

I would like to create a UserControl that act as a « Collapsible Panel ».

So I have a UserControl with two panels : a "Header panel" at the top, and
a
"Container Area Panel" docked to fill the remaining client area of the
UserControl.

The "Header panel" is for Text, Icon,.

The "Container Area Panel" is to host all the Control dragged from the
V.S.
toolbox.

How can I tell the designer that the "Container Area Panel" ONLY should
accept controls (dropped from the toolbox) ?

Actually my "Container Area Panel" has public modifiers.

I tried with that statement just above the declaration of my
CollapsiblePanel Class

[Designer(typeof(CollapsiblePanelDesigner))]

And I have made this class:

public class CollapsiblePanelDesigner : ParentControlDesigner

{

public override void Initialize(System.ComponentModel.IComponent
component)

{

base.Initialize(component);

CollapsiblePanel TmpCollapsiblePanel = component as CollapsiblePanel;

EnableDesignMode(TmpCollapsiblePanel.ClientPanel,
TmpCollapsiblePanel.ClientPanel.Name);
}

}

But this doesn't work .. I can drop controls on my CollapsiblePanel, but
designer allow to drop them also on the "Header Panel" (It shouldn't) .
And
the Designer "forget" to add the controls to the "Container Area Panel" at
run time : in the InitializeComponent() the control on the
CollapsiblePanel
are never added to the control (this line is missing [not generated]:
this.CollapsiblePanel1.Pan_Container.Controls.Add( Textbox1);)

Does anybody have an idea on what I'm missing ??

Thanks for any help or comments,

Steph.


Jul 20 '06 #2

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

Similar topics

41
by: AngleWyrm | last post by:
I have created a new container class, called the hat. It provides random selection of user objects, both with and without replacement, with non-uniform probabilities. Uniform probabilities are a...
0
by: VB Programmer | last post by:
I wanted to access some properties of a panel control that is on a different form. So, I went to the (Declarations) section of my main form (the form with the panel) and changed the panel (called...
5
by: antoine.viau | last post by:
Hi there ! I was looking at ajaxpatterns.org when I read this piece of JS code : var container; window.onload = function() { if ($("container")) {
1
by: Edward | last post by:
When designing a page in VS2003, in the toolbox, tab HTML there was a "Grid Layout Panel". I cannot find this control in VS2005. Where can I find the control now?
2
by: Simon Verona | last post by:
I have a problem, best explained by example. I have a usercontrol which contains a text box and a button. If the button is clicked then the calender control is displayed as a "popup" so that a...
5
by: Curious | last post by:
I installed a service program. It contained executables in the form of .exe and .dll files. And the service was started automatically after the install. Then, I UN-installed the program, but the...
3
by: Generic Usenet Account | last post by:
Hi, I am passing a container type (e.g. list<int>) to a function template but I am getting a compiler error when I try to declare an iterator for that type in the function. However, I am able...
11
by: 200dogz | last post by:
Hi guys, I'm making an expandable table which currently layers of <table>s are used to contain the table rows in order to show/hide them. This works, but having to format columns of the child...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.