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
205
GetVerticalScrollBarWidthResolved Obsolete - Fix unclear in documentation
posted

Upgrading from V18 to V20 we see this warning:

warning CS0618: 'ScrollBarLook.VerticalScrollBarWidthResolved' is obsolete: 'This property is obsolete and does not account for Dpi Scaling on multiple monitors. Use the GetVerticalScrollBarWidthResolved method that takes in a control.'

It is clear that we need to be using GetVerticalScrollBarWidthResolved and pass in a control

This is documented here: https://ko.infragistics.com/help/winforms/20.2/infragistics.win~infragistics.win.ultrawinscrollbar.scrollbarlook~getverticalscrollbarwidthresolved(control)

I am unclear which control is required here as we are running this on an UltraTree already

Also if I look at the other methods/properties in the documentation I would expect to see that they are now obsolete with an example fix

Here is a code fragment from where the warning is generated:

                UltraTree ultraTree = SelectedTab.LinkedTree();

                int horizontalTreePadding = 12;
                int ultraTreeWidth = this.Width - horizontalTreePadding;
                int elementIssueWidth = ultraTreeWidth;
                int elementIssueHeight = 30;
                int buttonBoundaryPadding = 90;
                int topBoundaryButtonPanel = (this.Height - buttonPanel.Top) + buttonBoundaryPadding;
                int ultraTreeHeight = ultraTabControl.Height - topBoundaryButtonPanel;

                if ((ultraTree.Nodes.Count * elementIssueHeight) > ultraTree.Height)
                {
                    elementIssueWidth -= ultraTree.ScrollBarLook.VerticalScrollBarWidthResolved;
                }