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
4165
Prevent Toolbar Options from showing on resize of form
posted

Hello,

Is there a way to prevent the below from showing if a form size is changed so that the tools do not fit on the screen?

The secondary issue to this is that users can edit values in the toolbars. There is an operation after which updates other values in the toolbar. This update operation is in a background worker. If the user makes the screen small enough so that any of the toolbar items are not visible which updates blows up the toolbar manager and we see this:

If it is not an easy solution is there a way to know that the toolbar is not showing completely? Maybe we can prevent the tool from going into edit mode?

Thanks,

M.

Parents
  • 34810
    Offline posted

    Hello Michael,

    I have been investigating into the behavior you are seeing, and at the moment, it does not appear that there is a publicly exposed property that will hide the “QuickCustomizeTool” to the right side of the UltraToolbarsManager when the toolbar is not wide enough to show all tools. There also does not exist anything public that can tell you when a tool has been “bumped” into this menu. That said, there are ways to hide this menu, as well as some non-public properties that you can use reflection to obtain the values of that can give you this information.

    In order to prevent this menu from showing up, I would recommend creating a class deriving from IUIElementCreationFilter that you will use with the UltraToolbarsManager.CreationFilter property. In that interface’s BeforeCreateChildElements method, you can check if the UIElement parameter is a QuickCustomizeToolUIElement, and if so, return true. Else, return false. This will remove the menu.

    If you would like to see if a particular tool is “bumped” from the toolbar, I would recommend using reflection to get the internal “BumpedFromToolbar” property. This property determines whether or not the tool would show in the QuickCustomizeTool to the left, and if any tool returns “true” for the value of this property, it can be assumed that the menu would normally be shown.

    I am attaching a sample project demonstrating the CreationFilter as well as the reflective method to get the “BumpedFromToolbar” property.

    Regarding the red-X that you are receiving, I have to imagine this is very likely due to something relating to the background worker, but without an error message, stack-trace or reproducible sample project, I am unsure as to what at the moment. Are you receiving any sort of error message when you receive this red X?

    Please let me know if you have any other questions or concerns on this matter.

    ToolbarItemsCutOffTest.zip

Reply Children