Hello,I'm trying to create a ToolBar based on UltraToolbarsManager.I want be able to add some pre defined tools which can be displayed or not.My problem: The UltraToolbarsManager is a component and has no OnPaint method that I can override - so my question: How to do this?
public class Toolbar: UltraToolbarsManager { public PredefinedTools ToolsPredefined { get; private set; } public Toolbar2() { this.ToolsPredefined = new PredefinedTools(); }
protected override void OnPaint(PaintEventArgs e) //will not work, because of no method to override { base.OnPaint(e); if (ToolsPredefined.New) Tools.Add(new ButtonTool("New")) } } [TypeConverter(typeof(ExpandableObjectConverter))] public class PredefinedTools { public bool New { get; set; } public bool Delete { get; set; } }
Thank you for support!
I'm not really sure what you are trying to accomplish here. Are you trying to enforce that a few tools are present at all times regardless of the customizations made by the user?
I want to use a "base toolbar" which I want to place on several forms. This toolbar should provide some pre-configurated tools, so the user (the person who designs the form) can activate these tools or not (show them on toolbar or not). One tool should e.g. "New". This means, if the person who designs is setting the property "New" to true, he will get a tool which is pre-configurated from me - this means, he get's a tool with an image, text, maybe some other appereance that I've set - and this tool will look an all forms the same.
The alternative to this is: Put a toolbarsmanager from Infragistics to each form and insert into each toolbar a new tool and set all proprties to the same value. If you want to change to image of a tool, you have to do this several times.