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

Hide propery bar only for one window

Hello,

Syncfusion has public the DockingManager.ShowCaption property that allows to hide/show the property bar for all dockable windows, but in my application I need to hide propery bar only for the one window. What the method should I use to support such functionality?

p.s. Now, to avoid this problem, I use ugly structure with 2 linked docking managers and splitter window. This is works as I want, exclude LoadDockState: method is failed to restore state if restored window was moved to the another manager.

WBR, Artjom

13 Replies

JK Joy K George Syncfusion Team August 14, 2006 04:55 PM UTC

Hi Artjom,

You may handle the following events to achieve your requirement.


//Handling the event DockStateChanged
private void dockingManager_DockStateChanged(object sender, DockStateChangeEventArgs arg)
{
//panel1 is the docked control whose property bar is to be hidden
DockHost dh = panel1.Parent as DockHost;
DockHostController dhc = dh.InternalController as DockHostController;
dhc.HideCaption = true;
}

private void dockingManager_NewDockStateEndLoad(object sender, EventArgs e)
{
DockHost dh = panel1.Parent as DockHost;
DockHostController dhc = dh.InternalController as DockHostController;
dhc.HideCaption = true;
}

Please try this method and let me know,if you need more assistance.

Regards,
Joy


AD Administrator Syncfusion Team August 14, 2006 07:26 PM UTC

Thanks for a quick response - now it works fine and I can continue evaluate your product.

p.s. Why DockHost & DockStateControllerBase* aren''t documented? There are many interesting things.

p.p.s one additional question - can I have a custom caption bar? For example, if i want to have control like XPTaskPane as standart Essential Tools dockable window I need to control a caption bar.

WBR, Artjom


MU Murugan Syncfusion Team August 16, 2006 03:57 PM UTC

Hi Artjom,
Custom caption bar can be created using the event ProvideGraphicsItems. It is fired whenever the caption bar is drawn. EventArgs has three properties for custom drawings.
CaptionBackground - used to set background for the caption bar.
CaptionForeground - used to set foreground of the caption bar.
CaptionFont - To set font styles.

private void dockingManager1_ProvideGraphicsItems(object sender, Syncfusion.Windows.Forms.Tools.ProvideGraphicsItemsEventArgs arg)
{
if(arg.IsActiveCaption == true)
{
arg.CaptionBackground = new LinearGradientBrush(arg.CaptionBounds, Color.Lavender , Color.White, (float)0);
arg.CaptionForeground = Color.Red;
arg.CaptionFont = new Font("Arial", 10, FontStyle.Bold);
}
else
{
arg.CaptionBackground = new LinearGradientBrush(arg.CaptionBounds, Color.Bisque, Color.White, (float)0);
arg.CaptionFont = new Font("Arial", 10);
}
}

Herewith I have attached the sample and KB link for your reference.Please go through this and let me know if you have queries.

How to draw a custom caption for docking windows?


CustomCaptionBar.zip

Thanks,
Murugan P.S


AD Administrator Syncfusion Team August 17, 2006 06:49 AM UTC

Hi, Murugan P S

Im not sure that this event is enough for my task:

My caption bar should have an active areas and I need to drawing it (not only change background but full GDI+ abilities) and also react on the user input on its (clicking, mouse moving etc).

WBR,Artjom


MA Malarvizhi Syncfusion Team August 17, 2006 11:36 AM UTC

Hi Artjom,


The DockingManager.ProviderGraphicItems event have a feature for customozing the Docked control captionbar Foreground,Background, Font alone. There is no feature to support GDI.

The DockingManager.ProviderGraphicItems event occurs whenever a dockable control''s caption need to be painted. There is no feature to handle the Click and MouseHover event.


Thank you for your interest.Let me Know,if you have queries

Regards,
Malarvizhi


AD Administrator Syncfusion Team August 18, 2006 07:04 AM UTC

oh,As I understand there is no way to have fully custom caption bar?

WBR, Artjom


JK Joy K George Syncfusion Team August 18, 2006 02:30 PM UTC

Hi Artjom,

Could you please let us know whether you want the Graphics object of Caption? So that you could perform all GDI+ operations on caption.


Regards,
Joy


AD Administrator Syncfusion Team August 21, 2006 07:11 AM UTC

>Could you please let us know whether you want the >Graphics object of Caption? So that you could >perform all GDI+ operations on caption.
Sure, all what I need it is a Graphics object for custom painting and mouse&keyboard events.

WBR,


JK Joy K George Syncfusion Team August 21, 2006 08:39 AM UTC

Hi Artjom,

We will try creating a sample with the existing DockingManager to meet your requirement.If that is not possible ,we are ready to take as a feature request.
I will update you by Thursday with more details.
Regards,
Joy


MA Malarvizhi Syncfusion Team August 24, 2006 01:32 PM UTC

Hi Artjom,

We added a new event named CaptionPaint Event for Cutomizing the Docked control Captionbar.

The DockingManager.CustomPaint Event will be fired after the DockingManager.ProvideGraphicItems Event.

The DockingManager.CaptionPaint EventHandler receives an argument of type PainEventArgs which support all GDI operation on the caption of the Docked control.

I have attached sample, please go through that,let me know you need further assistance.

CustomCaption.zip



Regards,
Malarvizhi.


MA Malarvizhi Syncfusion Team August 24, 2006 01:34 PM UTC

Hi Artjom,

We added a new event named CaptionPaint Event for Cutomizing the Docked control Captionbar.

The DockingManager.CustomPaint Event will be fired after the DockingManager.ProvideGraphicItems Event.

The DockingManager.CaptionPaint EventHandler receives an argument of type PainEventArgs which support all GDI operation on the caption of the Docked control.

I have attached sample, please go through that,let me know you need further assistance.

CustomCaption.zip



Regards,
Malarvizhi.


AD Administrator Syncfusion Team August 24, 2006 02:35 PM UTC

Your sample does that I want,but by absolutly unexpectedly way :).
Am learning more and more about ETools internals.

As I see , to process mouse & keyboard events I should override the following DockHost methods:

public void HandleDoubleClick(Point ptscreen);
public void HandleMouseDown(MouseButtons ...etc

Thank you for quick and detailed answers. Am satisfied and your company obtains a new customer just now - we will order licenses soon.


MA Malarvizhi Syncfusion Team August 29, 2006 05:59 AM UTC

Hi Artjom,

We added a new event named MouseEvent for handling the click event to customizing the Docked control captionbar.

The DockingManager.MouseEvent will be fired,when the caption bar of the Docked control is clicked.

The DockingManager.MouseEvent handler receives an argument of type MouseEventArgs to handle the left mouse button click event for paintaing the docked control caption bar.

I have attached sample,please go through that,let me know you need further assistance.

CustomCaption.zip


Regards,
Malarvizhi.

Loader.
Live Chat Icon For mobile
Up arrow icon