Tool Window Title bar image

Docking/MDI for Windows Forms Forum

Posted 18 years ago by puyopuy
Avatar
Hi Support,

Is it possible to add icon and background image for Tool Window’s title bar?

Thanks
Jeff

Comments (8)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jeff,

The icon support is on the TODO list and for bg images, you can set a general bg image already by using an ImageBackgroundFill for a property that most of the DockRenderers support. The property lets you set the BackgroundFill for active and inactive title bars.


Actipro Software Support

Posted 18 years ago by puyopuy
Avatar
Hi Support,

Are you talking about ToolWindow.Backgroundfill property? I tried that is not the title bar backgound, am I doing something wrong?

Thanks in advance
Jeff
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
No that is a BackgroundFill for the background of the ToolWindow itself. I'm thinking of VisualStudio2002DockRenderer.DockContainerTitleBarActiveBackgroundFill and VisualStudio2002DockRenderer.DockContainerTitleBarInactiveBackgroundFill. IDockRenderer doesn't define those properties however all our renderer implementations themselves have them (VisualStudio2002DockRenderer, VisualStudio2005DockRenderer, Office2003DockRenderer, etc.).


Actipro Software Support

Posted 18 years ago by puyopuy
Avatar
When I try the following codes

((VisualStudio2005DockRenderer)dockManager1.DockRenderer).DockContainerTitleBarActiveBackgroundFill =
new ImageBackgroundFill(Image.FromFile(@"C:\bg.gif"));

I got error message "Object reference not set to an instance of an object." So I modified it to

VisualStudio2005DockRenderer TitleImage = new VisualStudio2005DockRenderer();
TitleImage = (VisualStudio2005DockRenderer)dockManager1.DockRenderer;
(TitleImage).DockContainerTitleBarActiveBackgroundFill = new ImageBackgroundFill(Image.FromFile(@"C:\bg.gif"));


now I won't get the error message but still cannot get the background image.

Thanks
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Initially DockManager.DockRenderer will be null, meaning it's using the global renderer. There is a documentation topic on that.

You need to modify it like this:
VisualStudio2005DockRenderer renderer = new VisualStudio2005DockRenderer(); 
renderer.DockContainerTitleBarActiveBackgroundFill = new ImageBackgroundFill(Image.FromFile(@"C:\bg.gif"));
renderer.DockContainerTitleBarInactiveBackgroundFill = new ImageBackgroundFill(Image.FromFile(@"C:\bg.gif"));
dockManager1.DockRenderer = renderer;


Actipro Software Support

Posted 18 years ago by puyopuy
Avatar
Thanks, I can display the image now. Is it possible to have different image for different Tool Windows? e.g. If I got 2 Tool Window in a DockManager, can I have ToolWindow1 set to bg1.gif and ToolWindow2 set to bg2.gif?

Thanks in advance
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We don't have properties for that right now but I can add it to the TODO list for you.


Actipro Software Support

Posted 18 years ago by puyopuy
Avatar
Thank you so much
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.