Currently the unit test coverage of the PropertyGrid is 49.91%  The following code lacks unit test coverage. For details, please refer to [Code Coverage ](https://app.codecov.io/gh/dotnet/winforms/blob/main/src%2FSystem.Windows.Forms%2Fsrc%2FSystem%2FWindows%2FForms%2FControls%2FPropertyGrid%2FPropertyGrid.cs) **The code line under Constructor:** - [ ] `if (ScaleHelper.IsThreadPerMonitorV2Aware)` - [ ] `catch (Exception ex) when (!ex.IsCriticalException())` **Functions:** - [ ] PropertyGrid - [x] AddTab #14574 - [ ] CollapseAllGridItems - [ ] ClearTabs - [ ] CreateGridView `if (_inGridViewCreate)` - [ ] CreateTab - [ ] DisplayCommandsPane - [ ] Dispose `if (GetFlag(Flags.GotDesignerEventService))` - [ ] DividerDraw `if (y == -1)` - [ ] DividerInside - [ ] DividerLimitHigh - [ ] DrawXorBar - [ ] EnablePropPageButton - [ ] EnableTabs - [ ] EnsureLargeButtons - [ ] AddLargeImage - [ ] EnsurePendingChangesCommitted - [ ] ExpandAllGridItems - [ ] GetCommonTabs - [ ] GetElementFromPoint - [ ] GetUnwrappedObject - [ ] GetCurrentEntries - [ ] DropDownDone - [ ] HandleF4 - [ ] SaveState - [ ] LoadState - [ ] OnActiveDesignerChanged - [ ] OnChanged - [ ] OnChildMouseMove - [ ] OnChildMouseDown - [ ] OnComponentAdded - [ ] OnComponentChanged - [x] OnComponentRemoved #14561 - [ ] OnFontChanged - [ ] OnGotFocus - [ ] ScaleCore - [ ] OnLayoutInternal - [ ] OnMouseMove - [ ] OnMouseUp - [ ] OnRequestEdit - [ ] OnComComponentNameChanged - [ ] OnNotifyPropertyValueUIItemsChanged - [ ] OnPaint `if (_commandsPane.Visible)` - [ ] OnPropertyValueSet - [ ] OnTransactionClosed - [ ] OnTransactionOpened - [ ] OnTypeDescriptorRefreshed - [ ] OnTypeDescriptorRefreshedInvoke - [ ] OnViewPropertyPagesButtonClick - [ ] ProcessDialogKey - [ ] Refresh `if (GetFlag(Flags.RefreshingProperties))` - [ ] Refresh(bool clearCached) `if (Disposing || GetFlag(Flags.RefreshingProperties))` - [ ] RefreshTabs - [ ] ReleaseTab - [ ] RemoveTabs(PropertyTabScope classification, bool setupToolbar) - [ ] RemoveTab(int tabIndex, bool setupToolbar) - [ ] RemoveTab(Type tabType) `if (tabIndex == -1)` - [x] ResetHelpBackColor #14572 - [x] ResetHelpForeColor #14572 - [ ] ReplaceSelectedObject - [ ] TryGetSavedTabIndex `if (_designerSelections is null || ActiveDesigner is null)` - [ ] SelectViewTabButtonDefault - [ ] SetSelectState - [ ] SetupToolbar - [ ] ShowEventsButton - [ ] SinkPropertyNotifyEvents - [ ] ShouldForwardChildMouseMessage - [ ] UpdatePropertiesViewTabVisibility - [ ] UpdateSelection - [ ] WantsTab - [ ] RescaleConstants - [ ] WndProc **Properties:** - [ ] ActiveDesigner `if (_rootEntry is not null)` - [ ] CanCopy - [ ] CanCut - [ ] CanPaste - [ ] CanUndo - [ ] CommandsVisibleIfAvailable `if (hotcommandsVisible != _commandsPane.Visible)` - [ ] FreezePainting `get => _paintFrozen > 0;` - [ ] GridViewVisible - [ ] PropertySort `if (selectedGridItem is not null)` - [ ] SelectedObjects `Set` method - [ ] SortedByCategories - [ ] ToolStripRenderer `Get ` method - [ ] IComPropertyBrowser.ComComponentNameChanged - [ ] PropertyTabChanged `Remove` method - [ ] SelectedGridItemChanged `Remove` method - [ ] InPropertySet - [ ] UseCompatibleTextRendering `Set` method
Currently the unit test coverage of the PropertyGrid is 49.91%
The following code lacks unit test coverage. For details, please refer to Code Coverage
The code line under Constructor:
if (ScaleHelper.IsThreadPerMonitorV2Aware)catch (Exception ex) when (!ex.IsCriticalException())Functions:
if (_inGridViewCreate)if (GetFlag(Flags.GotDesignerEventService))if (y == -1)if (_commandsPane.Visible)if (GetFlag(Flags.RefreshingProperties))if (Disposing || GetFlag(Flags.RefreshingProperties))if (tabIndex == -1)if (_designerSelections is null || ActiveDesigner is null)Properties:
if (_rootEntry is not null)if (hotcommandsVisible != _commandsPane.Visible)get => _paintFrozen > 0;if (selectedGridItem is not null)SetmethodGetmethodRemovemethodRemovemethodSetmethod