473,544 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
CollapsiblePane l Class

[Designer(typeof (CollapsiblePan elDesigner))]

And I have made this class:

public class CollapsiblePane lDesigner : ParentControlDe signer

{

public override void Initialize(Syst em.ComponentMod el.IComponent
component)

{

base.Initialize (component);

CollapsiblePane l TmpCollapsibleP anel = component as CollapsiblePane l;

EnableDesignMod e(TmpCollapsibl ePanel.ClientPa nel,
TmpCollapsibleP anel.ClientPane l.Name);
}

}

But this doesn't work .. I can drop controls on my CollapsiblePane l, 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 InitializeCompo nent() the control on the CollapsiblePane l
are never added to the control (this line is missing [not generated]:
this.Collapsibl ePanel1.Pan_Con tainer.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 12054
OK, It works now !

I forgot to put the
"[DesignerSeriali zationVisibilit y(DesignerSeria lizationVisibil ity.Content)]"
statement above the propety that publish the "Container Panel" :

[DesignerSeriali zationVisibilit y(DesignerSeria lizationVisibil ity.Content)]
public Panel ContainerPanel
{
get
{
return Pan_Container;
}
}//EndProp ContainerPanel


"TheSteph" <Th******@NoSpa m.comwrote in message
news:OV******** ******@TK2MSFTN GP03.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
CollapsiblePane l Class

[Designer(typeof (CollapsiblePan elDesigner))]

And I have made this class:

public class CollapsiblePane lDesigner : ParentControlDe signer

{

public override void Initialize(Syst em.ComponentMod el.IComponent
component)

{

base.Initialize (component);

CollapsiblePane l TmpCollapsibleP anel = component as CollapsiblePane l;

EnableDesignMod e(TmpCollapsibl ePanel.ClientPa nel,
TmpCollapsibleP anel.ClientPane l.Name);
}

}

But this doesn't work .. I can drop controls on my CollapsiblePane l, 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 InitializeCompo nent() the control on the
CollapsiblePane l
are never added to the control (this line is missing [not generated]:
this.Collapsibl ePanel1.Pan_Con tainer.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
3016
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 degenerate case, and can also be stored. Here's the web-page, with complete source, illustration, and example usage. Take a look-see, and post...
0
1463
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 "panKnob") from "Friend WithEvents" to "Public Shared WithEvents" so that I could access it from another class (i.e. frmMain.panKnob.Visible=True")...
5
1682
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
2435
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
2305
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 date can be chosen. This replicates the date-picker control except that it has other checks in it (my user control also has the ability for other...
5
1668
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 service didn't get cleared from the "Service" panel. How can I delete this "service" from the "Services" panel?
3
1290
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 to invoke begin() and end() without any problem. Is there a way to declare an iterator for the container type? Sample code follows. Thanks,...
11
2224
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 table to be like its parent table can be quite annoying. Before I use tables to do this I use <tbody> to store the <tr>s. Doing so made the format...
0
7429
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7368
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7614
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
5301
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4922
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3414
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1844
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
990
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
671
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.