Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
Predefined tools in derived class: Override OnPaint event?
posted

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!