Prevent auto show on hover, change pin image

1 Answer 17 Views
Dock
Jure
Top achievements
Rank 2
Iron
Iron
Iron
Jure asked on 28 Feb 2022, 09:55 AM

Hi.

I have a Dock with a few ToolWindows. I'd like to change the default behavior:

- when a ToolWindow is collapsed (AutoHide) I don't want it to show when I hover on it, the user should click on it to show it

- because I only have AutoHide button and no Close button, I want to disable double click which pops up the ToolWindow outside the Dock which you can then close (I don't want that)

- I want to replace the Pin icon

 

Help please :)

1 Answer, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Mar 2022, 10:54 AM

Hello, Jure,

I will go straight to your questions:

1. RadDock manages the auto hide popup's showing by using an internal timer. Hence, there is no public API for disabling this functionality. However, RadDock offers the AutoHideWindowDisplaying event which allows you to cancel showing the auto hide popup. However, this will also prevent the popup when you click the tab. The AutoHideWindowDisplayingEventArgs gives you useful information about the action that triggers the auto hide popup:

        private void radDock1_AutoHideWindowDisplaying(object sender, Telerik.WinControls.UI.Docking.AutoHideWindowDisplayingEventArgs e)
        {
            if (e.DisplayReason == Telerik.WinControls.UI.Docking.AutoHideDisplayReason.TabItemHovered)
            {
                e.Cancel = true;
            }
        }

2. It is possible to disable the Floating state after double clicking by cancelling the DockStateChanging event: 

        private void radDock1_DockStateChanging(object sender, Telerik.WinControls.UI.Docking.DockStateChangingEventArgs e)
        {
            if (e.NewDockState == Telerik.WinControls.UI.Docking.DockState.Floating)
            {
                e.Cancel = true;
            }
        }

3. I have prepared a sample code snippet demonstrating how to change the pin icon for a ToolWindow for its Docked state:

          ToolTabStrip strip = this.toolWindow2.DockTabStrip as ToolTabStrip;
          strip.AutoHideButton.Image = Properties.Resources.pin;
          strip.AutoHideButton.DisplayStyle = DisplayStyle.Image;

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Jure
Top achievements
Rank 2
Iron
Iron
Iron
commented on 01 Mar 2022, 11:10 AM

Perfect! You're a star Dess. Thanks.
Tags
Dock
Asked by
Jure
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or