[Sv] - can i check control dockedin atuohidetab?

Hi Khanh, 

Thanks for contacting Syncfusion support. 

We have checked your queries and your requirements can be achieved by following the codes in below sample. Please refer the below video for same and let us know if you have further queries. The requirement to get the visibility of docked items in DockingManager can be achieved by using GetDockVisibility method as shown in below code snippet. 

C#: 
List<Panel> visbilePanels = new List<Panel>(); 
            foreach(Panel items in dockingManager1.ControlsArray) 
           
                if (dockingManager1.GetDockVisibility(items)) 
                    visbilePanels.Add(items); 
           




Regards, 
Niranjan Kumar Gopalan 


22 Replies 1 reply marked as answer

TG The GridLock June 8, 2020 05:36 AM UTC

Hi,
i have five question: Please show me how to achieve them
my question is:
x1: how to know if all panels have docked(hide) ?
x2: how to count total enable tab(hide and show) in dockingManager?
x3:is there any way to know if at least 1 tab is showing? or specify tab showing or dockedin
x4: how to dock panel (floating) to autohidetab(lefttab) by code?
x5 : I am trying to hide the panel during the autohidetab view, only when the user presses the dock will the panel be displayed because the autohidetab loads quite slowly, but it always seems to force the panel to show before the viewtab. Is that so? (DockingManager_AutoHideAnimationStart)
Thanks you!


TG The GridLock June 8, 2020 05:46 AM UTC

Hi Niranjan,
I am using the dockingmanager_AutoHideAnimationStart event, even though no tabs are open yet, the function GetDockVisibility still return control visibility, how do I know exactly it shows up?


UN Unknown Syncfusion Team June 8, 2020 06:59 AM UTC

Hi Khanh, 

Thanks for your update. 

We have checked your query “Need to know how to get current Auto Hidden tab is opened or not in DockingManager” and it can be achieved AutoHideAnimationStop event to get the visibility of current AutoHide tab as shown in below documentation.  


Regards, 
Niranjan Kumar Gopalan 



TG The GridLock June 8, 2020 08:39 AM UTC

I'm not sure but is GetDockVisibility going to say that having Dockingmanager have such a tab? because it always returns true. Can you check this:

-click on the tab, then the event will occur to allow view (press continue) then wait until the panel returns to autohidetab, although it is hidden, the result will still return true.

private void f_DocM_AutoHideAnimationStop(object sender, AutoHideAnimationEventArgs arg)
{
    if (arg.RollState == AutoHideRollState.RolledIn)
    {
        Windows.Forms.Control con = arg.Control;
        bool b = f_DocM.GetDockVisibility(con); 
    }
}


ah, maybe I didn't express it clearly, I mean when it was docked in autohidetab, it meant it was hidden (no longer displayed on the form and only see its tab.)
How to check the status of the tab?
from this (display full panel)

and this: (docked in autohidetab)

.


UN Unknown Syncfusion Team June 8, 2020 08:42 AM UTC

Hi Khanh, 

Thanks for your update. 

We have checked your query “Need to know how to get current Auto Hidden tab is opened or not in DockingManager” and it can be achieved AutoHideAnimationStop event to get the visibility of current AutoHide tab as shown below. GetDockVisibility method return always true since the control is visible as tab page in DockingManager. There is no direct property or method to meet your requirement, please use the below code to check the opened and hidden state of AutoHide tabs using DisplayRectangle in DockHost in form. 


C#: 
private void DockingManager1_AutoHideAnimationStop(object sender, Syncfusion.Windows.Forms.Tools.AutoHideAnimationEventArgs arg) 
       
            bool b; 
            DockHost dhost = arg.Control.Parent as DockHost; 
            if (dhost.DisplayRectangle != Rectangle.Empty) 
                b = true; 
            else 
                b = false; 
       


Regards, 
Niranjan Kumar Gopalan 


Marked as answer

TG The GridLock June 8, 2020 09:29 AM UTC

Hi Niranjan,
Your code works fine (my question x1,2,3,5 done!),
with question x4: After the float panel , how I can dock it back to the form tab (lefttab).
 I tried doccontrol (control, me, left, 100) or DockControlInAutoHideMode but it seems to be missing a step.


UN Unknown Syncfusion Team June 8, 2020 12:03 PM UTC

Hi Khanh, 

Thanks for your update. 

We have checked your query “Need to set the Floating window to AutoHide mode in DockingManager” and it can be achieved by docking the float window first and moving it to AutoHide mode. Please refer the below code snippet and video for same. 

C#: 
private void button2_Click(object sender, EventArgs e) 
       
            foreach (var item in dockingManager1.ControlsArray) 
           
                if ((item as Panel) != null && dockingManager1.IsFloating(item as Panel) ) 
               
                        dockingManager1.DockControl(item as Panel, this, DockingStyle.None, 150); 
                        dockingManager1.DockControlInAutoHideMode(item as Panel, DockingStyle.Left, 150); 
               
           
       


Regards, 
Niranjan Kumar Gopalan 



TG The GridLock June 8, 2020 07:29 PM UTC

Hi Niranjan,
Can you check it after pressing float, does it still work? if I hold title then drag out of the form, then I can dock again, but if press float ,I have this problem,



UN Unknown Syncfusion Team June 9, 2020 05:47 AM UTC

Hi Khanh, 

Thanks for your update. 

We have checked your query “Unable to AutoHide the floating window in DockingManager” and it can be achieved by disabling the SetFloatOnly property for respective panel in DockingManager. Please refer the below code and let us know whether your requirement has been achieved. 

C#: 
private void button2_Click(object sender, EventArgs e) 
       
            foreach (var item in dockingManager1.ControlsArray) 
           
 
                if ((item as Panel) != null && dockingManager1.IsFloating(item as Panel)) 
               
                    Panel panel = item as Panel; 
                    dockingManager1.SetFloatOnly(panel,false); 
                    dockingManager1.DockControl(panel, this, DockingStyle.None, 150); 
                    dockingManager1.DockControlInAutoHideMode(panel, DockingStyle.Left, 200); 
               
           
       


Regards, 
Niranjan Kumar Gopalan 



TG The GridLock June 9, 2020 07:21 PM UTC

Hi Niranjan,
I used to think about this but it was a bit confusing because I would need to set or unset ablefloating every time I floated, but if this was the only way I would use it.


TG The GridLock June 10, 2020 04:03 AM UTC

Hi Niranjan,
when I drag the panel, the control border is jerky (I have attached the video), besides how to hide the border (gray) of the control, is there any other way to reduce this?

Attachment: Video_200610_104626_5526ad0e.rar


UN Unknown Syncfusion Team June 10, 2020 04:17 AM UTC

Hi Khanh, 
 
Thanks for your update. 
 
Your requirement can only be achieved by setting the SetFloatOnly property as false, since when it is enabled for respective floating window , it restricts the respective window to dock in DockingManager. Currently there is no solution or support to reduce the gray area of floating window and we are unable to reproduce the jerky movements when dragging floating window please refer the below video for same. 
 
 
Regards, 
Niranjan Kumar Gopalan 
                                                                                                    



TG The GridLock June 10, 2020 10:14 AM UTC

Hi Niranjan,
I think maybe because its border was redrawn, so a jerk happened.
If I switch visualstyle to have a thicker border, it will be greatly reduced.
Also, when I right-click on the autohidetab and select the item, the baritems are not highlighted, hoping it will be added soon.


UN Unknown Syncfusion Team June 10, 2020 10:28 AM UTC

Hi Khanh, 
 
Thanks for your update. 
 
We have checked your query “Need to highlight the selected AutoHide tab item header when selected by context menu” and the reported behavior works properly when select the respective AHTab item using context menu. Please refer the below video for same. 
 
 
Regards, 
Niranjan Kumar Gopalan 
                                                                                                    



TG The GridLock June 11, 2020 08:18 AM UTC

Hi,
maybe it's not important yet but can it be highlighted? (highlight bar-item in contextmenu)


Edit: more question /  
x1: how do I change this color? 

x2: can i movetab if I use mousedown on autohidetab?


UN Unknown Syncfusion Team June 11, 2020 09:36 AM UTC

Hi Khanh, 
 
Thanks for your update. 
 
We have checked your query “Need to highlight bar item in context menu in in DockingManager” and currently this has already been logged as feature request. This feature will be included in any of our upcoming release, so we will update you once it is included. We appreciate your patience until then. Currently we don’t have support to change the tab back color of AhTabControl tab pages when visual style in Metro. But your requirement can be achieved by using Default visual style as shown in below code snippet and screenshot. You can drag and move AutoHide tab pages by enabling EnableDragAutoHiddenTabs property but it will disable the mouse down event of AhTabControl. Please let us know if you require further assistance. 
 
 
C#: 
DockHost dockHost = dockingManager1.ControlsArray[0].Parent as DockHost; 
 
            DockHostController dockHostController = dockHost.InternalController as DockHostController; 
 
            MainFormController mainFormController = dockHostController.ParentController.ToplevelController as MainFormController; 
 
            ahTabCtrlLeft = mainFormController.GetAHTabControl(DockingStyle.Left); 
 
            //ahTabCtrlLeft.DrawItem += AhTabCtrlLeft_DrawItem; 
            ahTabCtrlLeft.TabPanelBackColor = Color.GreenYellow; 
            ahTabCtrlLeft.ActiveTabColor = Color.Aqua; 
            ahTabCtrlLeft.InactiveTabColor = Color.Aqua; 
            ahTabCtrlLeft.ActiveTabForeColor = Color.Black; 
 
Screenshot : 
 
 
Regards, 
Niranjan Kumar Gopalan 
                                                                                                    



TG The GridLock June 11, 2020 10:59 AM UTC

Hi Niranjan,
a little more, can i change this line's color ?


/


UN Unknown Syncfusion Team June 11, 2020 11:31 AM UTC

Hi Khanh, 

Thanks for your update. 

We have checked your query and  there is no direct support to meet your requirement, but it can be achieved by using DrawItem event of AhTabControl  to draw new lines over the lines below the AutoHide tabs as shown in below screenshot. Please note that the calculation for drawing the line are updated manually as per convenience and refer the below sample for same. We hope your requirement has been achieved. 

                        
Screenshot: 
 
 
Regards, 
Niranjan Kumar Gopalan 



TG The GridLock June 11, 2020 12:13 PM UTC

Hi Niranjan.
I will check sample file soon.  
I have new question..
x10: If I only allow dock in forms and I want to disable dock panel to other panels, what should I do?( even I want to hide dockstyle if  target dock is panel)

if target dock is panel then hide this! (only form to show)

I have read this question but not sure how you use it?


UN Unknown Syncfusion Team June 11, 2020 12:23 PM UTC

Hi Khanh, 

Thanks for your update. 

We have checked your requirement “Need to restrict the dockability of panels in DockingManager” and it can be achieved by using SetOuterDockAbility method to restrict dockability of dragged panels. Please refer the below documentation for same.  


Regards, 
Niranjan Kumar Gopalan 



TG The GridLock June 11, 2020 06:39 PM UTC

Hi Niranjan,
I will check this out!


UN Unknown Syncfusion Team June 12, 2020 07:18 AM UTC

Hi Khanh, 
 
Thanks for your update. 
 
We will wait to hear from you. 
 
Regards, 
Niranjan  Kumar 
  


Loader.
Up arrow icon