Skip to content

fix: Hide icon when ShowIcon = false#3040

Merged
RussKie merged 2 commits intodotnet:masterfrom
RussKie:fix_3022_hide_icon_when_ShowIcon_false
Apr 14, 2020
Merged

fix: Hide icon when ShowIcon = false#3040
RussKie merged 2 commits intodotnet:masterfrom
RussKie:fix_3022_hide_icon_when_ShowIcon_false

Conversation

@RussKie
Copy link
Contributor

@RussKie RussKie commented Apr 6, 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 requested a review from a team as a code owner April 6, 2020 07:31
@ghost ghost assigned RussKie Apr 6, 2020
@RussKie RussKie added servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria and removed servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria labels Apr 6, 2020
@RussKie RussKie merged commit 2b98e51 into dotnet:master Apr 14, 2020
@RussKie RussKie deleted the fix_3022_hide_icon_when_ShowIcon_false branch April 14, 2020 01:33
@ghost ghost added this to the 5.0 milestone Apr 14, 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Form icon can not be (properly) hide.

1 participant