Hello everybody!
I am trying to create a UserControl that act as a (Expandable Panel).
I created a UserControl (LGradientPanel ) with two panels in it: LCaptionPanel and the LInnerPanel. The last one should "hold" the controls I will add to the UserControl.
The LCaptionPanel will have a gradient fill and the text (caption) of the panel. No controls should be added to this panel.
The LInnerPanel is the container area and shoul hold the controls dragged from the VisualStudo toolbox.
How can I "tell" the designer that ONLY the LInnerPanel should accept controls (dropped from the toolbox) ?
The problem I am getting is that when I drag controls into the GradientPanel, the controls are inserted in the LGradientPanel control. At run time, in the InitializeCompo nent(), I can see the following command line:
this.lGradientP anel2.Controls. Add(this.textBo x3);
I want to add them into the LInnerPanel. How can I do that? Something like
this.lGradientP anel2.InnerPane l.Controls.Add( this.textBox3);
Here is the structure I am using:
namespace LXPControls
{
internal class LCaptionPanel : System.Windows. Forms.Panel
{
(...)
public LCaptionPanel()
{
SetStyle(Contro lStyles.ResizeR edraw, true);
SetStyle(Contro lStyles.Opaque, true);
SetStyle(Contro lStyles.Selecta ble, true);
SetStyle(Contro lStyles.Contain erControl, false);
SetStyle(Contro lStyles.Support sTransparentBac kColor, true);
(...)
}
internal class LInnerPanel : System.Windows. Forms.Panel
{
(...)
public LInnerPanel()
{
SetStyle(Contro lStyles.ResizeR edraw, true);
SetStyle(Contro lStyles.Opaque, true);
SetStyle(Contro lStyles.Selecta ble, true);
SetStyle(Contro lStyles.Contain erControl, true);
SetStyle(Contro lStyles.DoubleB uffer, true);
SetStyle(Contro lStyles.Support sTransparentBac kColor, true);
(...)
}
[Designer("Syste m.Windows.Forms .Design.ParentC ontrolDesigner, System.Design", typeof(System.C omponentModel.D esign.IDesigner ))]
public class LGradientPanel : System.Windows. Forms.Control
{
(...)
private LCaptionPanel captionPanel;
private LInnerPanel innerPanel;
(...)
public LGradientPanel( )
{
SetStyle(Contro lStyles.ResizeR edraw, true);
SetStyle(Contro lStyles.Opaque, true);
SetStyle(Contro lStyles.Selecta ble, true);
SetStyle(Contro lStyles.Contain erControl, false);
(...)
}
}
Does anybody have an idea on what I am doing wrong?
Thanks everybody
Regards,
Carlos
0 2224 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Lokhan Wong |
last post by:
My question is whether it's possible to change the
properties of a panel, that resides on the webform
containing the usercontrol, in the usercontrol itself.
Like this:
<form>
<asp:panel visibility=false .... </asp panel>
<user:control> //a function here turns the visibilty to
true </user:control>
|
by: sergio |
last post by:
Hi,
I've created a usercontrol that acts like a container. Its a panel with color borders. The problem is that when I drop a control into this usercontrol the control added doesn't appear, then I need to select it in the properties window and "bring to front" in order to appear.
What I need is that is acts like a normal panel and all added controls appears as they are dropped into the panel.
Some idea?
Sérgio R. Pires
|
by: Alon |
last post by:
Hi,
I'm making my own control which holds some buttons ant textboxes and also
has a panel control.
in design time i want to drop another controls into the panel that is in my
usercontrol.
the problem is that the added controls are added to the usercontrol and not
to the panel...
10X,
|
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 data
types with other "popups" for validation)....
The problem is that if the user control is at...
|
by: Dino Buljubasic |
last post by:
Hi,
I am using C# 2.0 (VS2005) to build my user control that contains a
number of dynamically loaded ListViews. ListViewItems have their
ForeColor properties set to either black or blue to distinguish
between ListViewItems.
As long as no other application window (i.e. word or calculator, or
....) goes over my running form, ForeColor properties or each
ListViewItem stays black or blue as intended.
| |
by: TheSteph |
last post by:
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
|
by: Benton |
last post by:
Hi there,
I have a UserControl with a couple of textboxes and a couple of buttons
("Save" and "Cancel"). The Click event for this buttons is in the
UserControl's codebehind of course, so here's my question.
Once the UserControl is dropped onto the container page, how can I perform
some action on the codebehind of the container page from the codebehind of
the UserControl? For instance, suppose that the UserControl is dropped
inside one...
|
by: marfi95 |
last post by:
My application consists of basically a treeview on the left side,
along with a panel control that takes up the right side. When nodes
are clicked on the left, the data on the right side of the panel is
changed based on that type.
What I'm using are usercontrols, so I can do the visual design of them
in a separate window. when the node is clicked, I assign the parent
of the usercontrol to the panel control that is on the right side of...
|
by: John Kotuby |
last post by:
Hi all,
I have a page that displays the contents of a business document in HTML that
uses multiple select queries to provide the relevent data. There is a call
to the parent table and then multiple calls to related child tables. The
selects that return multiple rows (details) I have placed in Repeater
controls within the table that I use for formatting.
I now face the task of producing multiple documents on the same page
depending on a...
|
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 usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |