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.
Unfortunately, activation email could not send to your email. Please try again.

Capture double click event on caption bar of floating panel

Thread ID:

Created:

Updated:

Platform:

Replies:

115250 Jan 7,2014 09:23 AM Jan 20,2014 05:07 AM Windows Forms 6
loading
Tags: Tools
Sridharan Paul Pandian
Asked On January 7, 2014 09:23 AM

Is there anyway I can handle the double click event of a floating panel??


Kannan R [Syncfusion]
Replied On January 8, 2014 11:26 PM

Hi Sridharan,

 

Thank you  for using Syncfusion products.

 

We would like to let you know that, your requirement for handling double click event can be achieved by handling DockStateChanging event. Please make use of the below code snippet for your reference.

 

Code Snippet:[C#]

 

   void dockingManager1_DockStateChanging(object sender, Syncfusion.Windows.Forms.Tools.DockStateChangeEventArgs arg)

        {

            if (this.dockingManager1.IsFloating(arg.Controls[0]))

            {

                // Funtions can be performed here

            }

        }

 

 

We have also prepared sample as it tries to meet your requirement and it can be downloaded from below location.

 

Sample Location: Docking Manager.zip

 

Please let us know if you need any further assistance,

 

Regards,

Kannan.R


Sridharan Paul Pandian
Replied On January 9, 2014 11:56 PM

Hi Kannan,

Thanks for the response.

 Unfortunately your suggestion is not working out for my scenario.

 

I will give my scenario, it may help you to give me a solution

·         Already the panel is in floating state.

·         Have added some custom buttons for the floating form

Other settings of docking manager as follows

            this.dockingManager1.ShowCustomButtonsInFloating = true;

            this.dockingManager1.VisualStyle = Syncfusion.Windows.Forms.VisualStyle.Office2007;

            this.dockingManager1.CaptionButtons.Add(new Syncfusion.Windows.Forms.Tools.CaptionButton(Syncfusion.Windows.Forms.Tools.CaptionButtonType.Close, "CloseButton", 0, System.Drawing.Color.Transparent, "Close"));

            this.dockingManager1.SetDockLabel(this.panel, "Panel Name");

            this.dockingManager1.SetEnableDocking(this.panel, true);

            ccbpanel.MergeWith(this.dockingManager1.CaptionButtons, false);

            this.dockingManager1.SetCustomCaptionButtons(this.panel, ccbpanel);

 

My expectation is when I double click on the caption bar of the floating form, I need to change the size of the panel.



Sridharan Paul Pandian
Replied On January 10, 2014 09:58 AM

Hi Kannan,

I have updated the code (you have shared) to reproduce the issue that I am facing. On my code, I am positioning the panel as given below
            dockingManager1.SetDockVisibility(gradientPanel1, true);
            dockingManager1.DockControl(gradientPanel1, this, DockingStyle.Top, 10);
            dockingManager1.SetFloatOnly(gradientPanel1, true);
            ///
            ///Due to following lines double click event is not firing. Why?
            ///
            DockHost dockHostGen = gradientPanel1.Parent as DockHost;
            FloatingForm floatFormGen = dockHostGen.ParentForm as FloatingForm;
            if (floatFormGen == null)
            {
                return;
            }

            floatFormGen.Size = new Size(200, 200);
            floatFormGen.Location = this.PointToScreen(this.ClientRectangle.Location);
            ///
            ///
            ///
 Am I missing something here?


Docking_Manager_96134363.zip

Kannan R [Syncfusion]
Replied On January 16, 2014 12:15 AM

Hi Sridharan,

 

Thanks for your update.

 

Query

Comments

when I double click on the caption bar of the floating form, I need to change the size of the panel.

We would like to let you know that, this requirement can be achieved using Docking Manager FloatControl and SetControlSize function. Please make use of below code snippet to achieve this requirement.

 

Code Snippet:[C#]

 

this.dockingManager1.FloatControl(this.gradientPanel1, this.DisplayRectangle);

                this.dockingManager1.SetControlSize(this.gradientPanel1, new Size(this.gradientPanel1.Size.Width + 200, this.gradientPanel1.Size.Height + 200));

 

 

 

Due to following lines double click event is not firing. Why?

We would like to let you know that, once control is enabled for floating alone using “SetFloatOnly” function in Docking Manager, double click event will not be triggered since its dock able option will be disabled.

 

We have also prepared a sample as it tries to meet both the reported requirements and it can be downloaded from below location:

 

Sample Location: Docking Manager.zip

 

 

Please let us know if it helps,

 

Regards,

Kannan.R


Sridharan Paul Pandian
Replied On January 16, 2014 06:58 AM

Thanks for the response and the solution works for me. But I could not set the location of the panel, only size shall be modifed. is there anyway the location also modified?

thanks!

Kannan R [Syncfusion]
Replied On January 20, 2014 05:07 AM

Hi Sridharan,

Thanks for your update.

We would like to let you know that, your requirement for setting display location of Floating form can be achieved using 
below code snippet. 

Code Snippet:[C#]

 FloatingForm floatFormGen = dockHostGen.ParentForm as FloatingForm;
 if (floatFormGen != null)
 {
     floatFormGen.Location = new Point(0, workingArea.Bottom - Size.Height);
 }

We have also prepared sample as it tries to meet your requirement and please find it in attachment.

Please let us know if it helps,

Regards,
Kannan.R


DockingManager_b87bc868.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;