Reinstate state-aware field outlines for Net11 - #15080
Open
ricardobossan wants to merge 42 commits into
Open
Conversation
OneLoc currently receives a token for the first GitHub App installation (microsoft) instead of selecting the requested dotnet installation. That causes 403 Resource not accessible by integration when localization tries to create locfiles/* branches or update PRs. This syncs the focused installation-selection fix already merged in dotnet/arcade#17312 and propagated to dotnet/dotnet main. It flattens the installations response before filtering, requires exactly one owner match, and logs the selected installation. Evidence: - The App-token step succeeds, but OneLoc branch/PR writes fail with 403. - Replaying the same operation with the correctly selected dotnet installation token succeeds. - The change is limited to �ng/common/Get-GitHubAppToken.ps1 (14 insertions, 4 deletions). ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/winforms/pull/14917)
Proposed changes Introduce shared editable-control border color logic in ModernControlColorMath and use it across NET11 editable renderers. Uses a stable border color instead of ForeColor. Applies the shared border color to TextBoxBase, ComboBox.ModernComboAdapter, and UpDownBase. Uses a visible dark-mode border color. Customer Impact Customers using VisualStylesMode.Net11 can customize editable-control text colors without unintentionally changing the control border.
…1 visual styles (dotnet#14891) ## Root Cause `GroupBox` used larger NET11 caption/header metrics for `DisplayRectangle` in `FlatStyle.Standard` and `FlatStyle.Popup`. After switching from Classic to NET11, the content rectangle moved, but existing child controls kept their positions. This made controls near the top overlap the GroupBox header/border. ## Proposed changes Update modern GroupBox rendering and layout so that: - Preserve Classic layout metrics for Standard and Popup GroupBoxes in NET11 mode. - Preserve caption font settings while respecting system text scaling. - Keep the modern Popup appearance with an accent-colored header and border. - Leave Flat GroupBox behavior unchanged. - Add regression tests and update documentation.
## Proposed changes - Added DPI-aware glyph padding in `RadioButtonModernAdapter`, preventing RTL hover clipping - Added regression coverage in `RadioButtonTests` <!-- We are in TELL-MODE the following section must be completed --> ## Customer Impact - RadioButton glyphs now render correctly without clipping when using `RightToLeft.Yes` with .NET 11 visual styles, including during mouse hover. The change also respects DPI scaling.
…net#14910) ## Root Cause Modern GroupBox renderers painted opaque surfaces over `BackgroundImage`. Additionally: - Clipped regions recalculated image layout, making Header and Body appear as separate images. - Flat style only repainted the caption background. - Popup used an opaque accent Header. - System style exposed its background image when child controls requested the parent background. - Rounded child controls painted a solid `Parent.BackColor` mitigation outline, causing white halos over image backgrounds. ## Proposed changes - Render Standard, Flat, and Popup background images using one shared client-coordinate image. - Use graphics clipping without recalculating image layout. - Apply a subtle dark shade to the Standard Body to preserve Header/Body separation. - Blend the Popup Header with the system accent color at 50% opacity. - Prevent System GroupBox images from leaking into child-control backgrounds. - Skip solid rounded-border mitigation when the parent has a background image. - Add pixel-based regression tests for image continuity, overlays, System behavior, and rounded-control edges.
… Build ID 3057739 (dotnet#14930) Localized file check-in by OneLocBuild Task: Build definition ID 164: Build ID 3056573 Co-authored-by: dotnet-oneloc-localization[bot] <310689744+dotnet-oneloc-localization[bot]@users.noreply.github.com>
[main] Source code updates from dotnet/dotnet - Add NuGet sources for dotnet12 and dotnet12-transport
…dless of what child control is focused. (dotnet#14744) ## Proposed changes - Added an early check in ProcessKeyPreview for WM_KEYDOWN / WM_SYSKEYDOWN and WM_SYSCHAR. - Skipped DataGridView preview handling when the key message targets a hosted child control instead of the DataGridView itself. - Preserved existing behavior for the active EditingControl to avoid edit-mode regressions. ## Customer Impact - Fixes an issue where arrow keys intended for hosted child controls could be intercepted by the parent DataGridView. - Improves keyboard navigation behavior for controls hosted inside DataGridView.Controls.
…oves between monitors with different DPI (dotnet#14277) ## Proposed changes When calculating the desired window size during DPI transitions in `OnGetDpiScaledSize`, the non-client area (title bar and window borders) should be excluded from the `autoScaleFactor` calculation since Windows scales them linearly by DPI ratio, not by the font-based auto scale factor. **The fix:** 1. Uses `AdjustWindowRectExForDpi` to calculate the **non-client** area size at both old and new DPI 2. Subtracts the old DPI's non-client area from the current Size to get the client area 3. Scales only the client area by `autoScaleFactor` 4. Adds the new DPI's non-client area to get the final desired size
…ataSourceProviderService (dotnet#14133) ## Proposed changes - Re-enable the visibility logic for _addNewPanel in DesignBindingPicker <!-- We are in TELL-MODE the following section must be completed --> ## Customer Impact - Previously, the visibility logic for _addNewPanel was commented out(dotnet#9677), causing the panel to remain always visible, regardless of whether adding new data sources was supported. - This behavior diverged from .NET Framework, where visibility depends on the data source provider service and its capability to add new data sources. - The incorrect logic could mislead developers by showing an option that is not actually supported at runtime. - Restoring the original conditional logic ensures consistency with .NET Framework and improves design-time accuracy.
…dotnet#14152) ## Proposed changes - Update `DesignerUtils.cs`: Modified `ApplyTreeViewThemeStyles` method to apply `DarkMode_Explorer` theme when `Application.IsDarkModeEnabled` is true, otherwise use `Explorer` theme ## Customer Impact - Users working with Dark Mode enabled will now experience significantly improved readability when using PropertyGrid dropdowns for `DataSource`, `DisplayMember`
dotnet#14163) ## Proposed changes - Updated the button enable logic in **CollectionEditor.CollectionEditorCollectionForm.cs** - Up button: Only enabled when SelectedIndex > 0 (not at first position) - Down button: Only enabled when SelectedIndex < Items.Count - 1 (not at last position) ## Customer Impact - Buttons now correctly reflect whether items can be moved up/down
…umerable value (dotnet#14182) ## Proposed changes - Update method `DoubleClickRow` and `OnMouseWheel`: After calling `gridEntry.GetPropertyValueList()`, check `values.Length > 0` before trying to access `values[index]`. ## Customer Impact - Prevents IndexOutOfRangeException or similar crashes when users double‑click or scroll a PropertyGrid entry whose StandardValues list becomes empty at commit time.
…p options triggers a Win32Exception error (dotnet#14244) * Fix issue 14094 * Refer to the suggestions for code modification * Refer to the suggestions for code modification * Rename test case * Add ObjectDisposedException to SyncControlParent method * Revert the latest changes * Update test case * Handles feedback --------- Co-authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) <v-weidzh@microsoft.com>
…text in dark mode with System renderer (dotnet#14248) Fix issue 14089 Co-authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) <v-weidzh@microsoft.com>
…et#14575) * Fix cursor editor icon width calculation for proper DPI scaling * Handle feedback --------- Co-authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) <v-weidzh@microsoft.com>
…tnet#14576) * Fix MaskedTextBox PropertyGrid text editor DPI scaling at runtime * Handle feedback * Handle feedback --------- Co-authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) <v-weidzh@microsoft.com>
Co-authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) <v-weidzh@microsoft.com>
…4267) ## Proposed changes - Introduce an AppContext quirk switch `System.Windows.Forms.DataGridViewDarkModeTheming` (exposed via LocalAppContextSwitches / AppContextSwitches) to control whether DataGridView uses dark-mode-specific theming, defaulting to **enabled** for .NET 10 and allowing apps to opt out. - Add `ApplyDarkModeTheming` in DataGridView and call it only when dark mode is active and the new switch is enabled, centralizing the dark palette (background, gridlines, header/row colors) for high contrast on dark backgrounds. - Update DataGridView painting logic for several cell types—core cells, checkbox cells, combo box cells, and column header cells (**sort glyphs**)—to use adjusted colors and rendering that remain legible and visually correct in dark mode. - Improve DataGridViewLinkCell in dark mode by using shared `LinkUtilities` link colors (aligned with LinkLabel’s dark colors) and ensuring selected links render with appropriate selection foreground color for sufficient contrast. - Keep existing light-mode/legacy behavior unchanged when the AppContext switch is disabled, so existing applications can retain their current appearance without code changes. ## Customer Impact - Users get a DataGridView that automatically renders with readable, high-contrast colors in dark mode by default, while app developers can still opt out via an AppContext switch to preserve existing light-themed behavior if needed.
…ipboard APIs (dotnet#15022) * Fixes empty string scenario in bug dotnet#14322 Fix: Added a new AppContext switch: "Windows.Clipboard.ThrowExceptionsForGetAPIs" When set, the Clipboard Get* APIs will throw exception during a Clipboard failure. this switch is off by default. In off state the APIs will continue to swallow exceptions and return an empty string. Added unit tests. * PR comments. * Throwing exception for QueryGetData also.
[main] Source code updates from dotnet/dotnet - Disabiling code coverage for net481. - Updated comment.
…et#14216) * Fixes dotnet#14203 - When a RichTextBox is disabled in Dark Mode, the custom painting code used `ClientRectangle` instead of the proper text formatting rectangle, causing text to render incorrectly at the control's edge rather than within the text area bounds. - The `EndEllipsis` flag was incompatible with multiline text, causing premature truncation. - Use `EM_GETRECT` to get the proper text formatting rectangle that accounts for borders and padding. - Replace `EndEllipsis` with `TextBoxControl` flag for proper multiline text rendering. - Disabled RichTextBox controls now display multiline text correctly in Dark Mode. - No - Minimal - Manual - 11.0.100-alpha.1.25618.104 * Handles feedback * Handles feedback --------- Co-authored-by: Ricardo Bossan (BEYONDSOFT CONSULTING INC) (from Dev Box) <v-rbossan@microsoft.com>
…alues in VisualStylesMode.Net11 (dotnet#14865) * Fix issue 14859: CheckBox and RadioButton ignore explicit BackColor values in VisualStylesMode.Net11 * Sync the latest code and apply relevant fixes. * Handle feedback --------- Co-authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) <v-weidzh@microsoft.com>
…accent-colored focus indicator with VisualStylesMode = NET11 (dotnet#14860) * Fix issue 14772: Button hosted on a TabPage does not use the Windows accent-colored focus indicator with VisualStylesMode = NET11 * Handle feedback --------- Co-authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) <v-weidzh@microsoft.com>
…ly and displays an unexpected vertical scrollbar (dotnet#14827) * Fix issue 14795: ComboBox with DropDownStyle.Simple renders incorrectly and displays an unexpected vertical scrollbar * Handle feedback * Handle feedback * Fix test case feedback * Handle feedback --------- Co-authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) <v-weidzh@microsoft.com>
…WinEvent hook delegate (dotnet#14663) ## Proposed changes This prevents callbacks from invoking garbage-collected delegates. - Added `UnhookWinEventHooks()` method to centralize hook cleanup - Call unhook when handle is destroyed in `OnHandleChange()` - Added `_isReleasing` flag to prevent reentry during cleanup - Set `_winEventProcCallback = null` after unhooking to allow GC <!-- We are in TELL-MODE the following section must be completed --> ## Customer Impact - Applications using screen readers (e.g., Narrator) no longer crash when editing `PropertyGrid` or `TreeView` with accessibility enabled.
…net#15019) ## Proposed changes - Only remove the local override when `VisualStylesMode.Inherit` is explicitly assigned. Preserve explicitly assigned values even when they currently match the parent. ## Customer Impact - Customers can configure `VisualStylesMode` as `Classic` through the Visual Studio Properties window. Explicit values also remain stable if the parent’s visual styles mode later changes.
… per paint when NodeFont is set, leading to GDI handle exhaustion and crash (dotnet#14730) * Fix Issue 14721: TreeView.CustomDraw leaks one HFONT per visible item per paint when NodeFont is set, leading to GDI handle exhaustion and crash * Handle feedback * Optimize the code * Handle feedback * Handle feedback --------- Co-authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) <v-weidzh@microsoft.com>
[main] Source code updates from dotnet/dotnet
[main] Source code updates from dotnet/dotnet
…#14998) Merging on behalf of the contributor, as this is a bug fix, which we take for RC2. @jaywang-cn FYI.
> [!NOTE] > This is a codeflow update. It may contain both source code changes from > [the VMR](https://github.com/dotnet/dotnet) > as well as dependency updates. Learn more [here](https://github.com/dotnet/dotnet/tree/main/docs/Codeflow-PRs.md). This pull request brings the following source code changes [marker]: <> (Begin:81d064a4-929c-4152-b746-ee3acc24b4ed) ## From https://github.com/dotnet/dotnet - **Subscription**: [81d064a4-929c-4152-b746-ee3acc24b4ed](https://maestro.dot.net/subscriptions?search=81d064a4-929c-4152-b746-ee3acc24b4ed) - **Build**: [20260904.16](https://dev.azure.com/dnceng/internal/_build/results?buildId=3067261) ([330639](https://maestro.dot.net/channel/10847/github:dotnet:dotnet/build/330639)) - **Date Produced**: September 5, 2026 8:49:03 AM UTC - **Commit**: [a1bf0fa0dcff2d0f8aacf9da778f3f8c0c629221](dotnet/dotnet@a1bf0fa) - **Commit Diff**: [3c8d132...a1bf0fa](dotnet/dotnet@3c8d132...a1bf0fa) - **Branch**: [main](https://github.com/dotnet/dotnet/tree/main) **Updated Dependencies** - From [11.0.0-beta.26453.118 to 11.0.0-beta.26454.116][1] - Microsoft.DotNet.Arcade.Sdk - Microsoft.DotNet.Build.Tasks.Templating - Microsoft.DotNet.CMake.Sdk - Microsoft.DotNet.GenFacades - Microsoft.DotNet.Helix.Sdk - Microsoft.DotNet.RemoteExecutor - Microsoft.DotNet.XUnitV3Extensions - From [11.0.0-rc.1.26453.118 to 12.0.0-alpha.1.26454.116][1] - Microsoft.NET.Sdk.IL - Microsoft.NETCore.App.Ref - Microsoft.NETCore.ILAsm - Microsoft.NETCore.ILDAsm - Microsoft.Win32.SystemEvents - runtime.win-x64.Microsoft.NETCore.ILAsm - runtime.win-x86.Microsoft.NETCore.ILAsm - System.CodeDom - System.Configuration.ConfigurationManager - System.Diagnostics.DiagnosticSource - System.Formats.Nrbf - System.IO.Hashing - System.Reflection.MetadataLoadContext - System.Resources.Extensions - System.Runtime.Serialization.Formatters - System.Text.Encodings.Web - System.Text.Json - System.Windows.Extensions [marker]: <> (End:81d064a4-929c-4152-b746-ee3acc24b4ed) [1]: dotnet/dotnet@3c8d132...a1bf0fa [marker]: <> (Start:Footer:CodeFlow PR) ## Associated changes in source repos - dotnet/arcade@059e568...945f379 - dotnet/efcore@6828689...48ebeec - dotnet/fsharp@a29233c...df0e609 - dotnet/msbuild@cb5c9d7...fcb368d - dotnet/roslyn@5e194b4...0e119d1 - dotnet/runtime@8d1b156...25f20c2 - dotnet/sdk@d6b25e1...ed8295c - dotnet/source-build-assets@ee99bdb...5a9ef76 - microsoft/vstest@93ce2f7...335971c - dotnet/wpf@1cfc37f...fc9b54a <details> <summary>Diff the source with this PR branch</summary> ```bash darc vmr diff --name-only https://github.com/dotnet/dotnet:a1bf0fa0dcff2d0f8aacf9da778f3f8c0c629221..https://github.com/dotnet/winforms:darc-main-ff4d7573-fbdc-4126-9856-14f7628b53b5 ``` </details> [marker]: <> (End:Footer:CodeFlow PR) ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/winforms/pull/15047)
…as obscured at the bottom. (dotnet#14887) * Improve Net11 TextBox text layout by reducing excess vertical whitespace * Handling the issue of incomplete text display for TextBox and NumericUpDown controls under different scaling settings. * Adjust the height of the ComboBox control in .NET 1.1. * Adjusting the radian angle of a text box in Net11 mode * Adjust the outer border length of controls like UpDown to minimize the native TextBox's impact on the border. * Handle the failed test cases * Handle Copilot feedback * Ensure the borders of Net11 Modern rounded-corner controls remain thinner and more consistent across common DPI settings, mitigating the visual issue where rounded corners appear thicker than straight lines. * Handle failure test cases * Increase the bottom height of textbox when the control is focused. * The height of controls like Edit in Net11 mode has been readjusted so that it is no longer the same as the height of controls in Classic mode. * Adjust the size of the DataGridViewComboBoxCell; adjust the size of the UpDown control buttons. * Fixed an issue where text was obscured at certain scales. * Remove empty line * Fixed the issue of inconsistent height of ComboBox when DropDownStyle=DropDown and DropDownList. * Fixed an issue where the initial horizontal scroll position was incorrect at 350% DPI, causing the first character to be cut off. * Handle conflicts * Fix issue: ComboBox text appears vertically misaligned in DropDown mode, repro on all DPI values: 100%DPI ~ 300%DPI * Remove DataGridView related fixes * Handle failure test case * Handle conflicts --------- Authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) <v-weidzh@microsoft.com>
… ForeColor/BackColor updates in VisualStylesMode.Net11 (dotnet#14929) * Fix issue 14778: Controls inside GroupBox no longer reflect inherited ForeColor/BackColor updates in VisualStylesMode.Net11 * Handle copilot feedback * Handle feedback * Handle conflicts --------- Co-authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) <v-weidzh@microsoft.com>
…n RightToLeft is enabled and AutoSize is false (dotnet#14815) * Fix issue 14808: CheckBox/RadioButton: ToggleSwitch overlaps text when RightToLeft is enabled and AutoSize is false * Fixed the issue where images were being cut. * Handle feedback * Fix the test issue * Optimize the code * Update character encoding from UTF-8-BOM to UTF-8. * Handle feedback Authored by Simon Zhao (BEYONDSOFT CONSULTING INC) <v-weidzh@microsoft.com>
…t to the dark mode (dotnet#14715) * [DarkMode] the Pane in the Anchor Editor should adapt to the dark mode * Handle feedback * Method for updating the fill control --------- Co-authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) <v-weidzh@microsoft.com>
[main] Source code updates from dotnet/dotnet
… to NET11 visual styles (dotnet#14891)" (dotnet#15069) This reverts commit 69aa55b
[main] Source code updates from dotnet/dotnet
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1706864d-5b32-45c9-b727-0a686c2cb792
ricardobossan
requested review from
KlausLoeffelmann,
LeafShi1 and
SimonZhao888
September 10, 2026 19:58
ricardobossan
marked this pull request as ready for review
September 10, 2026 19:58
Layer the dotnet#14919 stroke updates onto the rendering work introduced by dotnet#14887. Select outline colors according to the active control state, bring back hover cues for Net11, and animate focus with a narrowing underline. Cover the resolver with tests and update TextBoxBase, ComboBox, and UpDownBase to follow the field-based stroke design.
Member
|
The base branch |
KlausLoeffelmann
force-pushed
the
integration/11.0-RC2
branch
from
September 11, 2026 08:05
92e4bf5 to
da321d2
Compare
ricardobossan
force-pushed
the
Issue_14906_stroke_additive
branch
from
September 11, 2026 14:43
91f1d50 to
03bfdb9
Compare
Member
|
@ricardobossan, can you fix the merge conflicts? |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #14906
Summary
This change brings back the per-state stroke model for Net11 editable-control borders. It
preserves the current animation and multiline behavior while improving border weight, hover
feedback, and focus geometry across the affected controls.
Why / background
This is an additive re-implementation of the intent from #14919. That earlier change predates
14887, which modified the same editable-control border and height-rendering paths. Applying both
rewrites directly would be fragile, so this version is built on the current main branch and keeps
the work already delivered by #14887. The implementation targets the Net11 VisualStylesMode in
the current .NET 12 alpha SDK.
What changed
Stroke model and color calculations
strokes, along with disabled-border helpers.
TextBoxBase rendering
the accent according to the existing FocusAmount animation.
None draws it only while focused.
Other editable controls
side and top borders.
Screenshots
Tests
Customer impact / behavior notes
Net11 mode now gives FixedSingle a hover state, including for the editable controls covered by
this work. Older VisualStyles modes remain unchanged in this respect. BorderStyle.None has no
border to strengthen on hover, so whether it should show another hover affordance remains an
open design question for review.
The focus indicator has moved from the animator's rounded band to a tapered fill confined to the
bottom edge; it remains animated through FocusAmount. This geometry change should receive focused
testing.
Read-only and disabled fields now blend continuously into their field surface in both light and
dark themes, without an inner border.
Testing
UpDownBase.
Fixes / references
Fixes #14906. Re-lands the intent of #14919 on top of #14887.
Microsoft Reviewers: Open in CodeFlow