Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request addresses a design-time consistency issue in PropertyGrid by hiding the VisualStylesModeChanged event, matching the existing hidden VisualStylesMode property, so the event no longer appears in the Designer’s Events window.
Changes:
- Added a
newVisualStylesModeChangedevent onPropertyGridannotated with[Browsable(false)]and[EditorBrowsable(Never)]to hide it from design-time surfaces. - Updated
PublicAPI.Unshipped.txtto reflect the newly declaredPropertyGrid.VisualStylesModeChangedmember.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/System.Windows.Forms/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs | Adds a shadowing event declaration with hidden design-time metadata attributes. |
| src/System.Windows.Forms/PublicAPI.Unshipped.txt | Records the newly declared PropertyGrid.VisualStylesModeChanged event in the unshipped API list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
Looks good to me! |
SimonZhao888
approved these changes
Jul 27, 2026
SimonZhao888
pushed a commit
to SimonZhao888/v-weidzh-winforms
that referenced
this pull request
Aug 5, 2026
) ## Root Cause The `VisualStylesMode` property has been explicitly hidden in `PropertyGrid` (using attributes such as `[Browsable(false)]`), yet the corresponding `VisualStylesModeChanged` event remains visible in the designer's events window. ## Proposed changes - Added a hidden `VisualStylesModeChanged` event declaration in `PropertyGrid.cs`, consistent with the already hidden `VisualStylesMode` property. <!-- We are in TELL-MODE the following section must be completed --> ## Customer Impact - Developers will not see the unavailable `VisualStylesModeChanged` event in the Events window when using the `PropertyGrid`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14803
Root Cause
The
VisualStylesModeproperty has been explicitly hidden inPropertyGrid(using attributes such as[Browsable(false)]), yet the correspondingVisualStylesModeChangedevent remains visible in the designer's events window.Proposed changes
VisualStylesModeChangedevent declaration inPropertyGrid.cs, consistent with the already hiddenVisualStylesModeproperty.Customer Impact
VisualStylesModeChangedevent in the Events window when using thePropertyGridRegression?
Risk
Screenshots
Before
PropertyGridhides theVisualStylesModeproperty, but the correspondingVisualStylesModeChangedevent is still exposed in the Events window.After
VisualStylesModeChangedevent is hidden in the Events windowTest methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow