{"record":{"id":"acf1a6d21bb6fe5e","repo":"dotnet/wpf","slug":"the-method-or-operation-is-not-implemented-winformsspinner","errorCode":null,"errorMessage":"The method or operation is not implemented.","messagePattern":"The method or operation is not implemented\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"warning","filePath":"src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WinFormsSpinner.cs","lineNumber":236,"sourceCode":"        {\n            if (iid == RangeValuePattern.Pattern && _type == SpinnerType.Numeric)\n            {\n                return this;\n            }\n            else if (_type == SpinnerType.Domain)\n            {\n                if (iid == ValuePattern.Pattern)\n                {\n                    return this;\n                }\n                else if (iid == SelectionPattern.Pattern)\n                {\n                    // Special case for a WinForms domain spinner. It is supposed to support\n                    // SelectionPattern, but because it is based on an edit control, this is\n                    // not possible unless each of the items in the spinner have been reviewed\n                    // at least once. Call out this unusual case by throwing the following\n                    // NotImplementedException.\n                    throw new NotImplementedException();\n                }\n            }\n            return null;\n        }\n\n        #endregion\n\n        // ------------------------------------------------------\n        //\n        // ProxyFragment interface implementation\n        //\n        // ------------------------------------------------------\n\n        #region ProxyFragment Interface\n\n        // Returns a Proxy element corresponding to the specified screen coordinates.\n        internal override ProxySimple ElementProviderFromPoint(int x, int y)\n        {","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WinFormsSpinner.cs#L218-L254","documentation":"UIA proxy for WinForms spinner controls throws NotImplementedException from GetPatternProvider when a WinForms domain spinner is asked for a pattern it should nominally support (SelectionPattern) but cannot provide. Because the spinner is backed by an edit control, selection support requires each spinner item to have been reviewed at least once; this unusual intermediate state is surfaced by throwing instead of returning a provider. It signals an unhandled pattern-request combination inside the client-side provider, not a bug in caller code.","triggerScenarios":"A UI Automation client queries the SelectionPattern (via GetCurrentPattern/FindFirst with PropertyCondition on SelectionPatternIdentifiers.Pattern) on a WinForms DomainUpDown-style spinner whose items have not all been reviewed at least once; GetPatternProvider reaches the special-case branch and throws instead of returning null.","commonSituations":"Automating legacy WinForms apps containing DomainUpDown/NumericUpDown controls with tools like FlaUI, TestStack.White, or raw UIA COM clients; accessibility test runs that enumerate all supported patterns on every element; apps where the spinner's item list was populated but never traversed.","solutions":["Traverse/review all items of the spinner at least once before querying SelectionPattern so the provider can supply it.","Wrap pattern queries in try-catch for NotImplementedException and treat the pattern as unsupported when it fires.","Query the element's supported patterns first via GetSupportedPatterns and skip SelectionPattern if not listed.","If you own the WinForms app, replace the edit-control-based DomainUpDown with a ListBox/ComboBox-backed control that supports UIA SelectionPattern natively."],"exampleFix":"// before\nvar pattern = spinner.GetCurrentPattern(SelectionPattern.Pattern);\n// after\nAutomationPattern[] supported = spinner.GetSupportedPatterns();\nif (supported.Contains(SelectionPattern.Pattern))\n{\n    var pattern = spinner.GetCurrentPattern(SelectionPattern.Pattern);\n}\nelse\n{\n    // fall back to Value/RangeValue pattern for edit-backed spinners\n}","handlingStrategy":"try-catch","validationCode":"// C# (UIA client)\nbool supportsSelection = element.GetSupportedPatterns()\n    .Contains(SelectionPattern.Pattern);","typeGuard":null,"tryCatchPattern":"try\n{\n    var sel = element.GetCurrentPattern(SelectionPattern.Pattern) as SelectionPattern;\n    // use sel\n}\ncatch (NotImplementedException)\n{\n    // provider cannot supply SelectionPattern yet; fall back to Value/RangeValue\n}","preventionTips":["Review/traverse all spinner items once before querying SelectionPattern on WinForms domain spinners.","Check GetSupportedPatterns before requesting a specific pattern.","Centralize pattern acquisition in a helper that maps NotImplementedException to unsupported."],"tags":["uiautomation","winforms","pattern-provider","not-implemented"],"backgroundTag":"method-not-implemented","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}