Question

I'm trying to make a Button always stay on top even after minimize the application. Quite like a floating Button, when I click the Button the application hide, click it again the application show.

Window can set the Topmost="True" property, what about the Button?

Était-ce utile?

La solution

You should make more one window with button, like this in XAML:

<Window AllowTransparency="True" ResizeMode="NoResize" WindowStyle="None"
        Topmost="True" ShowInTaskbar="False" SizeToContent="WidthAndHeight"
        Background="{x:Null}">
    <Button x:Name="HideShowButton" Content="Restore" />
</Window>

Button cannot exist without window, but with these properies window will be invisible.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top