[英]WPF : Maximize /Restore icons are missing from the Visual Studio Icon gallery. What are the work arounds?
我正在嘗試創建類似於Visual Studio的最大化和還原按鈕。 我下載了Visual Studio圖標庫,但那里只有最小化圖標可用。
按照此鏈接, https://social.msdn.microsoft.com/Forums/en-US/f19c19c8-60f6-4f2d-bfca-2cc365949769/i-cant-find-maximize-icon-in-visual-studio-20152017 -image-library?forum = csharpgeneral ,這些不是圖標,而是稱為segoe mdl asset的字體。 但是此字體僅在Win-10中可用。 我不在Win-10上,所以這里有什么選擇?
沒有共享的代碼,因為我不確定如何在代碼中完成。
這很簡單(有點粗糙)。 對於Max和Restore(純XAML),您需要的是放置在畫布上的Boder。
請參閱下面的代碼以開始使用:
最大按鈕:
<Button x:Name="CommandMax"
Width="15"
Height="15"
>
<Canvas Width="15"
Height="15">
<Border
Width="10"
Height="10"
BorderBrush="White"
BorderThickness="1,3,1,1" />
</Canvas>
</Button>
恢復按鈕:
<Button x:Name="CommandRes"
Width="15"
Height="15" >
<Canvas Width="15"
Height="15">
<Border Background="Gray"
Width="10"
Height="10"
Margin="2,0"
BorderBrush="White"
BorderThickness="1,3,1,1" />
<Border Background="Gray"
Width="10"
Height="10"
Margin="0,5"
BorderBrush="White"
BorderThickness="1,3,1,1" />
</Canvas>
</Button>
更改高度/寬度,顏色和背景以進行還原等。直到適合您的應用程序樣式。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.