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

Capture double click event on caption bar of floating panel

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


6 Replies

KR Kannan R Syncfusion Team January 9, 2014 04:26 AM UTC

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



SP Sridharan Paul Pandian January 10, 2014 04:56 AM UTC

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.




SP Sridharan Paul Pandian January 10, 2014 02:58 PM UTC

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


KR Kannan R Syncfusion Team January 16, 2014 05:15 AM UTC

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



SP Sridharan Paul Pandian January 16, 2014 11:58 AM UTC

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!


KR Kannan R Syncfusion Team January 20, 2014 10:07 AM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon