Skip to content

fix: Hide icon when ShowIcon = false#3055

Merged
RussKie merged 2 commits intodotnet:release/3.1from
RussKie:fix_3022_hide_icon_when_ShowIcon_false_p
May 14, 2020
Merged

fix: Hide icon when ShowIcon = false#3055
RussKie merged 2 commits intodotnet:release/3.1from
RussKie:fix_3022_hide_icon_when_ShowIcon_false_p

Conversation

@RussKie
Copy link
Contributor

@RussKie RussKie commented Apr 13, 2020

Fixes #3022

Proposed changes

Customer Impact

Customers now able to hide form's icon at runtime by setting myform.ShowIcon = false.
Workarounds involve either

  • setting an icon on a form to a transparent blank icon, or
  • performing an interop call to hide the icon before hiding the icon:
    if (myform.ShowIcon)
    {
        int extendedStyle = (int)User32.GetWindowLong(myform.Handle, User32.GWL.EXSTYLE);
        User32.SetWindowLong(myform.Handle, User32.GWL.EXSTYLE, (IntPtr)(extendedStyle | (int)User32.WS_EX.DLGMODALFRAME));
    }
    
    myform.ShowIcon =false;

Regression?

  • Yes, introduced in .NET Core 3.0

Risk

  • Minimal

Test methodology

  • manual tests in the integration test app
  • unit tests
Microsoft Reviewers: Open in CodeFlow

@RussKie RussKie added the servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria label Apr 13, 2020
@RussKie RussKie requested a review from a team as a code owner April 13, 2020 21:52
@RussKie RussKie self-assigned this Apr 13, 2020
@RussKie RussKie added this to the 3.1.4 milestone Apr 14, 2020
@leecow leecow removed the servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria label Apr 14, 2020
@merriemcgaw
Copy link
Member

Let's mark this a known issue for 3.1 including the workaround.

@RussKie RussKie added the servicing-rejected .NET Shiproom label indicating a PR is rejected from the given branch label Apr 15, 2020
@RussKie RussKie closed this Apr 15, 2020
@RussKie RussKie reopened this Apr 27, 2020
@codecov
Copy link

codecov bot commented Apr 27, 2020

Codecov Report

Merging #3055 into release/3.1 will increase coverage by 0.19747%.
The diff coverage is 100.00000%.

@@                  Coverage Diff                  @@
##           release/3.1       #3055         +/-   ##
=====================================================
+ Coverage     24.88340%   25.08087%   +0.19746%     
=====================================================
  Files              844         844                 
  Lines           260290      260310         +20     
  Branches         36896       36904          +8     
=====================================================
+ Hits             64769       65288        +519     
+ Misses          190807      190240        -567     
- Partials          4714        4782         +68     
Flag Coverage Δ
#Debug 25.08087% <100.00000%> (+0.19746%) ⬆️
#production 25.08087% <100.00000%> (+0.19746%) ⬆️
#test ?

@RussKie RussKie added servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria and removed servicing-rejected .NET Shiproom label indicating a PR is rejected from the given branch labels Apr 27, 2020
@codecov
Copy link

codecov bot commented Apr 27, 2020

Codecov Report

Merging #3055 into release/3.1 will increase coverage by 0.27660%.
The diff coverage is 100.00000%.

@@                  Coverage Diff                  @@
##           release/3.1       #3055         +/-   ##
=====================================================
+ Coverage     24.88340%   25.16000%   +0.27659%     
=====================================================
  Files              844         844                 
  Lines           260290      260310         +20     
  Branches         36896       36904          +8     
=====================================================
+ Hits             64769       65494        +725     
+ Misses          190807      190052        -755     
- Partials          4714        4764         +50     
Flag Coverage Δ
#Debug 25.16000% <100.00000%> (+0.27659%) ⬆️
#production 25.16000% <100.00000%> (+0.27659%) ⬆️
#test ?

@RussKie RussKie modified the milestones: 3.1.4, 3.1.6, 3.1.5 Apr 29, 2020
@RussKie RussKie added servicing-approved .NET Shiproom approved the PR for merge 🚫 * NO-MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) and removed servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria labels Apr 29, 2020
@RussKie RussKie removed the 🚫 * NO-MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) label May 14, 2020
@RussKie RussKie merged commit 23d6a46 into dotnet:release/3.1 May 14, 2020
@RussKie RussKie deleted the fix_3022_hide_icon_when_ShowIcon_false_p branch May 14, 2020 00:58
madewokherd pushed a commit to madewokherd/winforms that referenced this pull request Jun 7, 2020
@RussKie RussKie modified the milestones: 3.1.5, 3.1.6 Jun 10, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

servicing-approved .NET Shiproom approved the PR for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants