We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Copy a xpTaskBarBox object

In my app, there a xpTaskBar and several xpTaskBarBox boxes inside the bar. Each box has a panel control which contains variable controls in the panel. Do you know how to make a copy of the boxes including panel and its controls? I want to do it because I would like to add a box which is a copy of the existed one into the bar at run time. Thanks

7 Replies

AS Arun Srinivasan Syncfusion Team September 9, 2003 10:25 PM UTC

Hi Keith, The XPTaskBarBox does not implement the ICloneable interface and hence cloning it is not an option. But this is standard as most controls, (example Windows Forms TextBox control) do not implement the ICloneable interface. So what you could do is use the reference like you had in one of your earlier postings in the forums like: xpTaskBar1.Controls.Add(xpTaskBarBox1); xpTaskBar1.Controls.Add(xpTaskBarBox2); Arun


AD Administrator Syncfusion Team September 9, 2003 11:44 PM UTC

Hi Keith, I have modified the existing XPTaskBarDemo sample to implement a poor workaround. Please take a look into the code attached and let me know if this what you are looking for. Regards, Guru Patwal.


KE keith September 10, 2003 01:03 PM UTC

The codes you provided works just fine. It is great if you can provide some codes that allow users drag a box and move to another position in the bar. One question is to make a copy of one of boxes then add it into the bar. The difficulty is that I don't how many controls and what kind of them in a box to be copied from.


AD Administrator Syncfusion Team September 11, 2003 04:49 PM UTC

Hi Keith, Adding the drag and drop feature to a XPTaskBarBox item has been considered as a 'feature request' (QA# 281). We will do our very best to implement this feature at the earliest and include it in our future releases. Thanks for your patience. Regards, Guru Patwal.


KE keith September 11, 2003 08:17 PM UTC

how to make a copy of a box inside a bar then add it into the bar? thanks Keith


RP Ramesh Praveen Syncfusion Team September 12, 2003 12:05 PM UTC

Keith, Controls in the .Net framework do not provide any support for Copying (Cloning). That's true with the XPTaskBarBoxes too. The cloning metaphor is achieved in the framework by creating a class that implements all the functionality and then creating multiple instances of that class, which would act like clones. In your case, you could have a derived XPTaskBarBox, that will initialize itself with the Panels and such and also listen to the events generated and perform the appropriate action. You could then create different instances of this type (which will look and act like Clones). Hopefully, I am clear here. Regards, Praveen Ramesh


KE keith September 12, 2003 01:32 PM UTC

You are right. There is no way to copy a box in a bar.. Thanks Keith

Loader.
Live Chat Icon For mobile
Up arrow icon