
Introduction
I was needing a panel that was able to expand/collapse on both X and Y axis, but could not find one that would do it for the Y axis so decided to write my own. The main idea of this is inheriting the Panel control and having a "caption" control docked left, right, up or down.
Using the code
In order to use this control, while in design mode go to the toolbox window pickup your category to include the control, right click it and select "Choose Items..." and then locate the ExtendedPanel.dll file. Soon after, you should be able to see the ExpandedPanel as one of the items available to drag and drop on your forms.
Control properties
The control provides the following properties :
State - Returns the state of the object which can be either collapsed, collapsing, expanded, or expanderd
Animation - States whether this control should animate the collapsing / expanding process
BorderColor - The color used to draw the border lines
CornerStyle - The way the border should appear rounded or normal
Moveable - Specifies if this control can be moved by dragging the caption with the mouse
CornerStyle - Set up if the border will have normal corners or rounded ones
AnimationStep - Specifies the size used to expand/collapse the control
CaptionAlign - Set where the caption control for this panel should be. It can be left, right, up or down
CaptionBrush - Set how the painting of the caption should occur. It can either be solid or gradient
CaptionColorOne - Starting color used if gradient option is chosen or the color used for the solid brush style
CaptionColorTwo - Starting color used if gradient option is chosen or the color used for the solid brush style
CaptionFont - Font used in drawing the caption
CaptionText - The text present in the caption control
CaptionTextColor - The color used in drawing the caption text
CaptionSize - Set the size in pixels for the caption
CaptionImage - The icon displayed in the caption
Architecture
The main classes defined in this assembly are present in the following list:
BufferPaintingCtrl - Inherits the Panel control, adding support for double buffering. Will talk shortly about this.
DirectionCtrl - Defines the control displaying the arrow showing the direction the panel will expand or collapse.
CornerCtrl - Defines the control supporting the border drawing either with normal or rounded corners.
CaptionCtrl - Defines the caption control for the panel.
ExpandedPanel - The extended panel supporting collapsing/expanding and also dragging
CollapseAnimation - The class creating the background worker responsible for the expanding/collapsing animation.

By default, whenever a Paint event is raised (WM_PAINT - message is sent ) the control paints itself directly to the Graphics object (Device Context for the ones familiar with Win32). If this process is done repeatedly the annoying flickering effect comes into play. Double buffering technique is quite known among developers involved in windows programming, and comes to help us reduce the flickering. The guys at Microsoft made the use of this double buffering quite simple in .NET, all you have to do is set up some flags for your control. For most scenarios this will do the job, but in some scenarios manual control over the process is required. All you have to do in order to enable this for your control is set up the following styles to true: ControlStyles.AllPaintingInWmPaint, ControlStyles.UserPaint, ControlStyles.DoubleBuffer.
Once you have done this the drawing process is changed a little bit, instead of the Graphics object (device context) for the screen the Paint handler receives another Graphics object for an in-memory bitmap. So what happens is that the control is drawing itself to an invisible image. Once the drawing process finishes this image is copied on the screen device context. Because only one graphic operation is performed on the screen graphics the flickering effect can be reduced if not removed.
So the idea behind the BufferPaintingCtrl class is to set up this flags in its constructor, as some of the classes defined in the assembly are handling the paint event:
protected BufferPaintingCtrl()
{
this.SetStyle( ControlStyles.AllPaintingInWmPaint |
ControlStyles.UserPaint |
ControlStyles.OptimizedDoubleBuffer |
ControlStyles.DoubleBuffer,true);
UpdateStyles();
}
CornerCtrl
CornerCtrl is supposed to offer support for drawing the borders either with normal corners or rounded ones. The control has a graphic path object that is used in the Paint handler. The next listing presents the method for instantiating the graphic path object; the cornerSquare is used to define the region that will contain the ellipse whose arc is being drawn, if rounded corners are being selected. This member has to be defined in the child classes in order to control the rounding, otherwise we won't get any. protected virtual void InitializeGraphicPath()
{
if (null != graphicPath)
{
graphicPath.Dispose();
graphicPath = null;
}
graphicPath = new GraphicsPath();
switch (cornerStyle)
{
case CornerStyle.Rounded:
graphicPath.AddArc(0, 0, cornerSquare, cornerSquare, 180, 90);
graphicPath.AddLine(cornerSquare - cornerSquare / 2, 0,
Width - cornerSquare + cornerSquare / 2 - 1, 0);
graphicPath.AddArc(Width - cornerSquare - 1, 0, cornerSquare,
cornerSquare, -90, 90);
graphicPath.AddLine(Width - 1, cornerSquare - cornerSquare / 2,
Width - 1, Height - cornerSquare + cornerSquare / 2);
graphicPath.AddArc(Width - cornerSquare - 1,
Height - 1 - cornerSquare, cornerSquare, cornerSquare, 0, 90);
graphicPath.AddLine(cornerSquare - cornerSquare / 2, Height - 1,
Width - cornerSquare + cornerSquare / 2, Height - 1);
graphicPath.AddArc(0, Height - cornerSquare - 1, cornerSquare,
cornerSquare, 90, 90);
graphicPath.AddLine(0, cornerSquare - cornerSquare / 2, 0,
Height - cornerSquare + cornerSquare / 2);
break;
case CornerStyle.Normal:
graphicPath.AddLine(0, 0, Width-1, 0);
graphicPath.AddLine(Width-1, 0, Width-1, Height-1);
graphicPath.AddLine(Width-1, Height-1, 0, Height-1);
graphicPath.AddLine(0, Height-1, 0, 0);
break;
default:
throw
new ApplicationException("Unrecognized style for rendering the corners");
break;
}
}
ExpandedPanel
As shown in the UML class diagram this class is embedding a CaptionCtrl object. Based on the option this will be docked on one of the four directions left, down, right, or up. Just after initialization of all components, InitializeComponent method, the code is setting up two handlers. First one is for handling the event raised when the user clicks the direction control (causing the panel to collapse/expand), and the latter for dragging (in case this option is enabled). Here is the snapshot of the code i am talking about:
captionCtrl.SetStyleChangedHandler(new
DirectionCtrlStyleChangedEvent(CollapsingHandler));
captionCtrl.Dragging += new CaptionDraggingEvent(CaptionDraggingEvent);
I won't talk about the dragging part as the code is self explanatory. I will focus though on the part with collapsing/expanding. As mentioned earlier the direction control present in the caption control is defining a handler for the click event. Once the event is captured, the control style is being changed (basically pointing to the opposite direction it was pointing before the click), and raises the event causing ExtendedPanel object to expand/collapse. The panel object in its handler will prepare all the context needed for the animation, will instantiate the CollapseAnimation object (if this would be the case), will set its properties and will start the background thread to perform behind the scenes steps required for the animation (I won't list this method but you can find it in the source code). We are getting now to the most challenging part in writing this code. Within the lines of this method you will find a call to ChangeCaptionParent. This will be the case when the caption has been set to be docked either on the bottom or on the right side. More attention is required, will explain why next. As you know any control has a location (starting point) from where is being rendered and a size (width and height). All containers have their child controls location defined relative to its upper left corner. By changing the width/height of the container all child controls having the location set to be greater than the new size will become invisible. So will be the case in the two scenarios i mentioned; we have to bring the caption control back where it should be, by updating its location. By doing so a WM_PAINT message will be raised. Changing panel size will cause the painting event to be raised for this one as well, and will be facing a situation where seeing-not seeing the caption will repeat very fast, causing the very annoying effect of flickering (and we don't want that).
So my solution for the problem was to take out the panel caption during animation, keeping it though at the "same" location from the user's point of view. So during the animation period the caption control parent would be the same as the panel parent.
private void ChangeCaptionParent()
{
this.captionCtrl.Parent = this.Parent;
this.captionCtrl.Location = new Point(this.Location.X + this.Width -
this.captionCtrl.Width, this.Location.Y + this.Height -
this.captionCtrl.Height);
Win32Wrapper.SetWindowPos(this.Handle, this.captionCtrl.Handle,
0, 0, 0, 0,
Win32Wrapper.FlagsSetWindowPos.SWP_NOMOVE |
Win32Wrapper.FlagsSetWindowPos.SWP_NOSIZE |
Win32Wrapper.FlagsSetWindowPos.SWP_NOREDRAW);
backupMoveable = moveable;
moveable = false;
}
The panel is notified at every step of the animation that it should update its size and in the aforementioned cases its location. The end of the animation needs special treatment as well as in the scenarios where the docking is at the bottom or right, the caption control has to be brought back into the panel control.
private void OnNotifyAnimationFinished(object sender)
{
if (captionAlign == DirectionStyle.Down)
{
Win32Wrapper.SetWindowPos(this.captionCtrl.Handle, IntPtr.Zero, 0,
this.Height - this.captionCtrl.Height, 0, 0,
Win32Wrapper.FlagsSetWindowPos.SWP_NOREDRAW |
Win32Wrapper.FlagsSetWindowPos.SWP_NOZORDER |
Win32Wrapper.FlagsSetWindowPos.SWP_NOSIZE |
Win32Wrapper.FlagsSetWindowPos.SWP_HIDEWINDOW );
this.captionCtrl.Parent = this;
this.captionCtrl.Visible = true;
moveable = backupMoveable;
}
else
{
if (captionAlign == DirectionStyle.Right)
{
Win32Wrapper.SetWindowPos(this.captionCtrl.Handle, IntPtr.Zero,
this.Width - this.captionCtrl.Width, 0, 0, 0,
Win32Wrapper.FlagsSetWindowPos.SWP_NOREDRAW |
Win32Wrapper.FlagsSetWindowPos.SWP_NOZORDER |
Win32Wrapper.FlagsSetWindowPos.SWP_NOSIZE |
Win32Wrapper.FlagsSetWindowPos.SWP_HIDEWINDOW);
this.captionCtrl.Parent = this;
this.captionCtrl.Visible = true;
moveable = backupMoveable;
}
}
SetState();
}
Adding the caption back where it should be it is a bit tricky as well. I have to perform two actions, set the panel as its parent and update its location (there is a great chance the current location within the panel parent control to be different than what we need). Either way it is done, parent set first and then location updated or vice versa, is not a reliable solution. If I set the parent first due to the actual location coordinates the caption will be moved (probably where it will become invisible) into the panel control and only setting the location would bring it back where it should be. We would end up having the unwanted flickering effect. If I set the location first related to the panel control (we would want the caption either at the bottom or on the right side) a paint event is raised and will cause the control to be drawn somewhere else on the screen. Only setting the caption parent to be the panel again we would have the things back to normal. But this is not a solution an user would accept. So Win32 to the rescue. The Windows API SetWindowsPos method is giving us the chance to set the new location without repainting message raised. Having used this method would save me having the caption appearing somewhere else on the screen. I can now safely set the parent to be the panel again, and because I was hiding it set it back to visible.
I know I can't always explain very well (good thing i am not a teacher), but i hope you have got the idea.
Conclusion
Hopefully, someone out there would find this control useful. I am pretty sure there is room for improvement, so any feedback would be appreciated.
History
- July 2006 - Version 1.0.0
- August 2006 - Version 1.2.0
- Bug fixing - made control thread safe
- Bug fixing - while in collapsed mode sometimes you could click on the caption bringing the controls on top
- August 2006 - Version 1.3.0
- Bug fixing - there were errors once the control was set to have zero size with/height
- Changes -
CaptionPercent has become CaptionSize and this will no longer be percentage of the control width/height depending of the docking
- Added - Collapse/Expand method to raise those events without the need to click the mouse anymore
- Added - Docking corrections. Changing the caption size sometimes was overlapping the contained controls. So whenever the caption size is changed the inner controls are moved accordingly.
- Added - State property supports the set accessor design time only. Setting it to collapsed the control will first be showed as collapsed.
- October 2006 - Version 1.4.0
- Bug fixing - choosing the collapsed method would not update the ">>" control leaving the control stuck.
- Bug fixing - If the caption was set to be Down/Right then collapsing the control was not possible if the panel had the Anchor set to Bottom/Right.
|
|
 |
 | programatically expanding the panel mahone | 3:20 12 Oct '09 |
|
 |
Is there an easy way to expand a panel programatically (e.g. extendedpanel1.expand())? Thank you
|
|
|
|
 |
 | Need for Signing ExtendedPanel.dll Raguvaran | 2:34 24 Sep '09 |
|
 |
Hi, Can u sign the dll ExtendedPanel.dll you have provided inside src folder you have given for download. This could be helpful for all.
Thanks, Raguvaran.
|
|
|
|
 |
 | Code??? Member 4690505 | 10:41 29 Oct '08 |
|
 |
Hi...This control looks great....
i am new to windows application...can i directly use to .dll file provided in the demo?????
and can you please divide the code in different module so that i can understand through which code what desgin comes on the screen??? becoz when i start debuggin then i keep on pressing F11 and fianlly all the desgin is displayed....
If its possible then can you please divide the code in such way that i can understand the flow of the code and design obtained through particular code...
thanks....
|
|
|
|
 |
 | Bug NOT fixed?!?!?!? Johnny J. | 23:52 26 Oct '08 |
|
 |
October 2006 - Version 1.4.0 Bug fixing - If the caption was set to be Down/Right then collapsing the control was not possible if the panel had the Anchor set to Bottom/Right.
Well, I'm using the latest version and have one ExtendedPanel set to dock right with cation right aligned. And it can only expand - not collapse, so it seems like the bug is actually not fixed????
Cheers, Johnny J.
|
|
|
|
 |
 | Nice control, BUT... Johnny J. | 2:12 17 Oct '08 |
|
 |
There's a couple of changes that would make it even better:
1) If you implemented the change suggested by another user and made the CaptionImage property an Image instead of an icon 2) If you could change the color of the ">>" control 3) If the clientarea in which you place your controls didn't contain the caption bar. As it is now, a control that is added to the panel and set to dock.fill will be partly hidden behind the caption bar (unless you set the padding property accordingly 4) If the captionimage (when the caption bar is vertical) was centered horizontally.
As it is now I have a question: How do you change the caption icon at runtime?
/Johnny J.
|
|
|
|
 |
|
 |
OK, here's my findings so far:
1) Changing the icon to image is not so hard. You have to change the type from Icon to Image in 3 or 4 places, and in the CaptionCtrl.cs OnPaint event you change DrawIcon to DrawImage. No big deal.
2) This feature exists, but strangely enough it's not exposed in the designer. the attributes for DirectionCtrlColor and DirectionCtrlHoverColor are set to Browsable(false) in ExtendedPanel.cs
3) This is a little more tricky - I'll have a look at that later if I have time. For the time being, I'll just use the Padding Property to adjust the contents. If anobody has got a better solution, please post it.
4) Easily fixed. In the CaptionCtrl.cs OnPaint event just change the following code:
if (captionIcon != null) { if (Width >= Height) { e.Graphics.DrawImage(captionIcon, (int)cornerSquare / 6, (int)(Height - captionIcon.Height) / 2); e.Graphics.DrawString(text, this.Font, new SolidBrush(textColor), new PointF(xAxis + (int)cornerSquare / 6 + captionIcon.Width, yAxis + (int)cornerSquare / 6), stringFormat); } else
{ e.Graphics.DrawImage(captionIcon, (int)(Width - captionIcon.Width) / 2, (int)cornerSquare / 6); e.Graphics.DrawString(text, this.Font, new SolidBrush(textColor), new PointF(xAxis + (int)cornerSquare / 6, yAxis + (int)cornerSquare / 6 + +captionIcon.Height), stringFormat); } } else
{ e.Graphics.DrawString(text, this.Font, new SolidBrush(textColor), new PointF(xAxis + (int)cornerSquare / 6, yAxis + (int)cornerSquare / 6), stringFormat); }
PS: The code has been altered to use image types according to 1), if you haven't made that change, just use DrawIcon instead of DrawImage...
/Johnny J.
|
|
|
|
 |
 | Step error setiseeker | 3:48 7 Feb '08 |
|
 |
Hi,
This is a great piece of code.
If animation is turned off, after a number of expand collapse operations, I get a step error because the step is = 0.
any ideas?
|
|
|
|
 |
 | Quite Edited! Andrea_86 | 0:39 2 Feb '08 |
|
 |
First, i changed Icon to Image, to allow using every type of graphic file.
second: To avoid another expanding request when the control is already expanding (height double up!!!), i edited the DirectionControl.cs file (only one event):
void OnMouseClickEvent(object sender, System.Windows.Forms.MouseEventArgs e) {
try
{ if( (((Stepi.UI.ExtendedPanel)this.Parent.Parent).State == ExtendedPanelState.Expanding) || (((Stepi.UI.ExtendedPanel)this.Parent.Parent).State == ExtendedPanelState.Collapsing) ) return; } catch { } ......
|
|
|
|
 |
 | Toolbar in Panel doesn't render properly Johnny J. | 1:30 23 Nov '07 |
|
 |
Hi
Tried placing an Extended Panel in an MDI container and then I placed a toolbar in the Extended Panel (along with other controls).
The other controls rendered properly, but the backcolor of the toolbar isn't rendered properly. In some cases it's black, and in other cases gray striped.
Has anybody got a fix for that?
I worked around it by placing a normal panel inside the extended panel and then placing my controls in the normal panel. Then it worked, but that shouldn't really be necessary?!?!?
Cheers, Johnny J.
|
|
|
|
 |
 | Mouse Sizeable ExtendedPanel deep42 | 3:42 27 Sep '07 |
|
 |
I decided to add some additional code, so the user can resize the panel with the mouse. If you are interested, here are the changes for ExtendedPanel.cs.
Add the private field sizeable. (I did it behind declaration of field captionCtrl)
/// <summary> /// True if panel is sizeable /// </summary> public bool sizeable = false;
Then add the property Sizeable (anywhere in region properties)
[Category("Behaviour")] //[DefaultValue(DirectionStyle.Up)] [Description("Set/Get whether it is Sizeable")] public bool Sizeable { get { return this.sizeable; } set { sizeable = value; } }
And at least add the following code at the start of method WndProc just before the line if (!DesignMode && firstTimeVisible && m.Msg == 0x18):
if (!DesignMode && Sizeable && (m.Msg == Win32Wrapper.WM_NCHITTEST)) { Point Hit = new Point((int)m.LParam & 0xFFFF, (int)m.LParam >> 16); Hit = this.PointToClient(Hit);
int DistToBorder = 5; if (Hit.X < DistToBorder) { if (Hit.Y < DistToBorder) { m.Result = (IntPtr)Win32Wrapper.HTTOPLEFT; return; } if (Hit.Y > this.ClientRectangle.Bottom - DistToBorder) { m.Result = (IntPtr)Win32Wrapper.HTBOTTOMLEFT; return; } m.Result = (IntPtr)Win32Wrapper.HTLEFT; return; } else if (Hit.X > ClientRectangle.Right - DistToBorder) { if (Hit.Y < DistToBorder) { m.Result = (IntPtr)Win32Wrapper.HTTOPRIGHT; return; } else if (Hit.Y > this.ClientRectangle.Bottom - DistToBorder) { m.Result = (IntPtr)Win32Wrapper.HTBOTTOMRIGHT; return; } m.Result = (IntPtr)Win32Wrapper.HTRIGHT; return; } else if (Hit.Y < DistToBorder) { m.Result = (IntPtr)Win32Wrapper.HTTOP; return; } else if (Hit.Y > this.ClientRectangle.Bottom - DistToBorder) { m.Result = (IntPtr)Win32Wrapper.HTBOTTOM; return; } }
And of course in class Win32Wrapper we have to add:
public const int HTLEFT = 10; public const int HTRIGHT = 11; public const int HTTOP = 12; public const int HTTOPLEFT = 13; public const int HTTOPRIGHT = 14; public const int HTBOTTOM = 15; public const int HTBOTTOMLEFT = 16; public const int HTBOTTOMRIGHT = 17;
public const int WM_NCHITTEST = 0x0084;
-Peter
|
|
|
|
 |
 | Panel can be dragged out of parent's client rect [modified] deep42 | 1:43 27 Sep '07 |
|
 |
I didn't like that the panel can be dragged out of its parents client rectangle. So if you move the panel out of the parent window, it wont be no longer visible unless you resize the parent window accordingly.
To avoid this I have changed the OnMouseMoveEvent of CaptionCtrl a little bit:
void OnMouseMoveEvent(object sender, MouseEventArgs e) { //is the mouse down if (mouseDown && Dragging != null) { if (mouseX != e.X || mouseY != e.Y) { // Dont let control move out of parent's client rectangle if ((this.Parent != null) && (this.Parent.Parent != null)) //added { //added Point p = this.PointToScreen(e.Location); //added p = this.Parent.Parent.PointToClient(p); //added if (!this.Parent.Parent.ClientRectangle.Contains(p)) //added { //added return; //added } //added } //added int width = mouseX - e.X; int height = mouseY - e.Y; //raise the event Dragging(this, new CaptionDraggingEventArgs(width, height)); } } }
-Peter
-- modified at 7:28 Thursday 27th September, 2007
|
|
|
|
 |
 | Added ExpansionBegin Event [modified] CSharpTpa | 9:26 20 Sep '07 |
|
 |
I needed the ability to detect before the panel expanded so I added the code below. This way I could dynamically change the contents and/or the panel etc... There may be a better way of doing it, but this seems to work.
Modify & Compile ExtendedPanel.cs
//==========+++++ //Add this delegate at the top with the rest under the namespace //=========== public delegate void NotifyBeginAnimationCallback(); //==========+++++
//==========+++++ //Add this to the Members region //========== /// <summary> /// the callback for notifying the animation has begun /// </summary> private NotifyBeginAnimationCallback callbackNotifyBeginAnimation = null; //==========+++++
//==========+++++ //Add this to the Public region //========== // Exposed event /// /// Fired when the animation expanding is just beginning /// public event NotifyBeginAnimationCallback BeginExpanding { add { callbackNotifyBeginAnimation += value; } remove { callbackNotifyBeginAnimation -= value; } } //==========+++++
//==========+++++ Modify OnNotifyAnimationEvent in the Events region //========== /// <summary> /// The Event raised when the size of the control should change (during colapsing/expanind /// </summary> /// <param name="sender">instance of the object making the call</param> /// <param name="size">the new size for this panel</param> private void OnNotifyAnimationEvent(object sender, int size) { this.Invoke(callbackNotifyAnimation, size);
//==========+++++ <= NEW CODE //This fires before the panels content is visible, so changes to the panel and/or contents //happens before it is expanded if (this.CaptionAlign == DirectionStyle.Left || this.CaptionAlign == DirectionStyle.Right) { if (this.Width == size && this.state == ExtendedPanelState.Expanding) { this.Invoke(callbackNotifyBeginAnimation); } }
if (this.CaptionAlign == DirectionStyle.Up || this.CaptionAlign == DirectionStyle.Down) { if (this.Height == size && this.state == ExtendedPanelState.Expanding) { this.Invoke(callbackNotifyBeginAnimation); }
}
if (this.CaptionSize == size && this.state == ExtendedPanelState.Collapsing) { this.Invoke(callbackNotifyBeginAnimation); } //==========
}
SAMPLE USE ========== -->add these events to the test app -->this uses panel 2 & 3
//demonstrates the caption top/bottom private void extendedPanel2_BeginExpanding() { if (extendedPanel2.State == Stepi.UI.ExtendedPanelState.Collapsing) this.extendedPanel2.Width = 76; if (extendedPanel2.State == Stepi.UI.ExtendedPanelState.Expanding) this.extendedPanel2.Width = 235; }
//demonstrates the caption left/right private void extendedPanel3_BeginExpanding() { if (extendedPanel3.State == Stepi.UI.ExtendedPanelState.Collapsing) this.extendedPanel3.Height = 110; if (extendedPanel3.State == Stepi.UI.ExtendedPanelState.Expanding) this.extendedPanel3.Height = 215;
}
Tom Kelly - {Tampa}
-- modified at 17:59 Thursday 20th September, 2007
|
|
|
|
 |
 | Expand expandable panel at runtime Sumit.Rulez | 0:00 18 Sep '07 |
|
 |
I want to dynamically expand the expandable panel at runtime on a button click event. I tried with expanGuestInfo.Refresh() expanGuestInfo.State = Stepi.UI.ExtendedPanelState.Expanded expanGuestInfo.Show()
and even i have a lable in expandable panel, and i want to put text at runtime
|
|
|
|
 |
 | Add them in a Table layout and make there dock = Fill. It stops working Armoghan Asif | 4:35 31 Aug '07 |
|
 |
Add control in a Table layout and make its dock = Fill. It stops working
With doc also it does not work if the direction is not top
|
|
|
|
 |
 | Controls are not shown upon expanding ury@work | 9:06 29 Aug '07 |
|
 |
Kudos on the great work! I have a bug which was mentioned in past discussion with no apparent resolution and I wonder if there are any solutions: Whenever I collapse then expand *some* of my ExtendedPanel objects, the child controls remain hidden (Visible = false). Any idea?
Thanks in advance, Ury
|
|
|
|
 |
 | Two quick additions I made. Jab_RTS | 12:58 30 Jul '07 |
|
 |
First off a big thankyou to Stefan, this will save me a lot of time !
In the #region Public of ExtendedPanel.cs I added
public event NotifyAnimationFinishedCallback ExpandCollapseFinished { add { callbackNotifyAnimationFinished += value; } remove { callbackNotifyAnimationFinished -= value; } }
public ExtendedPanelState PanelState() { return this.state; }
The event fires when either a collapse or expand has finished and the method will return the state the control is in.
Hope this is useful. Jim.
|
|
|
|
 |
|
 |
Hi, I tried what you did. But I am getting the following error and i dont know how to solve it. I am new with C# programming.
Thanks in advance
Error 2 Inconsistent accessibility: property type 'type' 'Stepi.UI.NotifyAnimationFinishedCallback' is less accessible than property 'property' 'Stepi.UI.ExtendedPanel.ExpandCollapseFinished' C:\Documents and Settings\ting\Escritorio\Projects References\ExtendedPanel\ExtendedPanel\ExtendedPanel\ExtendedPanel.cs 225 54 ExtendedPanel
And i get the Error exactly in the following part of the code: ExtendedPanel.cs
221 // Exposed event. 222 /// 223 /// Fired when the animation of collapsing or expanding is finished 224 ///
225 public event NotifyAnimationFinishedCallback ExpandCollapseFinished 226 { 227 add { this.callbackNotifyAnimationFinished += value; } 228 remove { this.callbackNotifyAnimationFinished -= value; } 229 }
|
|
|
|
 |
 | inactive control item hubertus95 | 7:18 10 Jul '07 |
|
 |
When I "choose items..." to include the dll, I get 3 controls but they are gray-out "inactive" and I cannot drop it into my design. What should I do?
hubertus1995@yahoo.com
|
|
|
|
 |
|
 |
Actually, I did the reset toolbox, and now I cannot add this control at all. Can someone help me? please.
hubertus1995
|
|
|
|
 |
 | Bug in animation Haukur Hrafn Þorsteinsson | 6:13 25 May '07 |
|
 |
There seems to be a bug in the animation effect. If the panel is clicked on while it is animating it goes all crazy and eventually disappears. You can see it if you run the Demo Project and click a few times on the red panel down to the right.
Otherwise a great control. Good work.
Thanks.
|
|
|
|
 |
 | Any further development on this control UltraWhack | 8:35 23 Apr '07 |
|
 |
Hi, Just checking to see if there has been any further development on this control ?
|
|
|
|
 |
|
 |
Hi sorry for not updating the control with the latest requirements but i intend to do so in the next 2 weeks.
|
|
|
|
 |
|
 |
I wanted to suggest that in your next version maybe consider raising some events from the control. For example, in my application I wanted a status box that floated on the screen but I wanted the users to be able to expand it and see more details of what is going on. I needed to resize the host form when the panel was expanded or collapsed. Events such as BeforeExpand, Expanding, Expanded, BeforeCollapse, Collapsing, and Collapsed would let me tie some code into what the user was doing with the panel. I downloaded the source and I'm going to try to wire in those events myself for now.
That being said... I really like the control. The visual look is great and it really functions very well.
|
|
|
|
 |
|
 |
jgleim
Did you happen to get the code done for raising the events as mentioned ? If you did would you be so kind as to post it.
Thanks, Jim
|
|
|
|
 |
 | ExtendedPanel.dll KulbirS | 20:47 14 Mar '07 |
|
 |
I am not able to locate ExtendedPanel.dll file.
|
|
|
|
 |
|
|
Last Updated 6 Oct 2006 |
Advertise |
Privacy |
Terms of Use |
Copyright ©
CodeProject, 1999-2010