Modifying renderer properties

Navigation for Windows Forms Forum

Posted 12 years ago by Gareth - Director, Slyce Software Limited
Version: 2.0.0075
Avatar
Is there any way to modify properties of Renderers, specifically NavigationBarHeaderBackgrounfFill.Color etc? A custom renderer would be useful, but I only really want to change one or two properties.

Thanks,
Gareth.

Comments (5)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Gareth,

Absolutely... we made our renderers so you can design your own from scratch or simply change the properties of ours. NavigationBarHeaderBackgroundFill is a BackgroundFill type so you can create any sort of BackgroundFill to set to that property. Some examples are SolidColorBackgroundFill, TwoColorBackgroundFill, ImageBackgroundFill, etc. All of them are in the ActiproSoftware.Drawing namespace.

When you run the NavigationBar sample, you can click the Renderer tag, select a BackgroundFill property, and click the ... button to see a designer window that shows the BackgroundFill in detail with a preview and allows you to select other types of BackgroundFills.


Actipro Software Support

Posted 12 years ago by Gareth - Director, Slyce Software Limited
Avatar
Thanks for that. I forgot to mention that I am trying to do this from code at runtime. I can see how to do it via the designer, but the relevant properties don't seem to be accessible through code.... I must be missing something!

Thanks,
Gareth.
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The core renderer properties are simple interfaces, like INavigationBarRenderer. Each implementation exposes its own properties. So you need to cast the renderer (from RendererResolved property) to its appropriate renderer type. Then you can access the BackgroundFill properties.

So once you have that property reference, you can create a background fill like this:
new ActiproSoftware.Drawing.SolidColorBackgroundFill(Color.Red);
Set that to the property and you're all done.


Actipro Software Support

Posted 12 years ago by Gareth - Director, Slyce Software Limited
Avatar
Excellent! Thank-you. I didn't realise what RendererResolved was for. For anyone interested, an example of the full code is:
ActiproSoftware.UIStudio.Dock.Office2003DockRenderer renderer = (ActiproSoftware.UIStudio.Dock.Office2003DockRenderer)dockManager.DockRendererResolved;
renderer .DockContainerTitleBarInactiveBackgroundFill = new ActiproSoftware.Drawing.TwoColorLinearGradient(Color.LightBlue, Color.DarkBlue, 90, ActiproSoftware.Drawing.TwoColorLinearGradientStyle.Normal);
Cheers,
Gareth.

[Modified at 11/27/2006 06:11 PM]
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
By the way, RendererResolved returns the global renderer if no control-specific renderer
is set in the Renderer property. There is a documentation that covers renderers
so check that out for more info.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.