image
如果你想要直接修改ComboBox背景顏色為自訂義漸層顏色,你應該會跟我遇到一樣的狀況,怎麼改都沒有作用@@
 1: <ComboBox Background="Yellow">
 2: <ComboBox.Resources>
 3: <!-- color of ComboBoxItem -->
 4: <SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="Yellow" />
 5: <!-- Mouse over color of ComboBoxItem -->
 6: <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Red" />
 7: </ComboBox.Resources>
 8: <ComboBoxItem>One</ComboBoxItem>
 9: <ComboBoxItem>Two</ComboBoxItem>
 10: <ComboBoxItem>Three</ComboBoxItem>
 11: </ComboBox>

me1237guy 發表在 痞客邦 留言(0) 人氣()

image

一上二下排列,基本上可以先定義兩列兩行,然後針對第一列(Grid.Row=0)特別定義跨兩行,也就是Grid.ColumnSpan=”2”第二列因為沒有跨行所以不用另外定義Grid.ColumnSpan
 1: <Grid>
 2: <Grid.RowDefinitions >
 3: <RowDefinition Height="100" />
 4: <RowDefinition />
 5: </Grid.RowDefinitions>
 6: <Grid.ColumnDefinitions >
 7: <ColumnDefinition Width="200" />
 8: <ColumnDefinition />
 9: </Grid.ColumnDefinitions>
 10:  
 11: <!--Panel-->
 12: <Border Grid.Row="0" Grid.Column="0" Background="Blue" Grid.ColumnSpan="2" />
 13: <!--<Border Grid.Row="0" Grid.Column="1" Background="LightSalmon" />-->
 14: <Border Grid.Row="1" Grid.Column="0" Background="Green" />
 15: <Border Grid.Row="1" Grid.Column="1" Background="Red" />
 16: </Grid>

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
Markup Extensions and WPF XAML
新增一個類別 SaySomething.cs
定義兩個靜態屬性English和Chinese
 1: namespace WpfApp7
 2: {
 3: public class SaySomething
 4: {
 5: public static string English
 6: {
 7: get { return "Hello, how are you today?"; }
 8: }
 9: public static string Chinese
 10: {
 11: get { return "哈囉!今天好嗎?"; }
 12: }
 13: }
 14: }

me1237guy 發表在 痞客邦 留言(0) 人氣()

image

加入參考 using System.Windows.Threading;

me1237guy 發表在 痞客邦 留言(0) 人氣()

image

me1237guy 發表在 痞客邦 留言(0) 人氣()

https://www.facebook.com/MATLAB/videos/372170376698253/

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
新增主控台應用程式
輸入關鍵字”openTK”安裝後,在你專案的參考中應該會出現OpenTK套件

me1237guy 發表在 痞客邦 留言(0) 人氣()

37

me1237guy 發表在 痞客邦 留言(0) 人氣()

1. WPF – MVVM (一)2. WPF – MVVM (二)3. WPF – MVVM (三)4. UWP 和 WPF 对比

me1237guy 發表在 痞客邦 留言(0) 人氣()

image

 1:  
 2: enum Animal
 3: {
 4: Dog = 0x0001,
 5: Cat = 0x0002,
 6: Duck = 0x0004,
 7: Chicken = 0x0008
 8: }
 9: static void Main(string[] args)
 10: {
 11: Animal animals = Animal.Dog | Animal.Cat;
 12: Console.WriteLine(animals.ToString());
 13: Console.ReadKey();
 14: }

me1237guy 發表在 痞客邦 留言(0) 人氣()

先說結論:  readonly比較不會出錯,一般狀況新版的dll蓋過去就好,但如果是const狀況,須將整個專案重新編譯,才不會出錯!
參考資料:[C#.NET] 定義常數時用 readonly 好? 還是 const 好?

me1237guy 發表在 痞客邦 留言(0) 人氣()

(1) 在 Windows Forms 中裝載 WPF 控制項
https://docs.microsoft.com/zh-tw/dotnet/framework/wpf/advanced/walkthrough-hosting-a-wpf-composite-control-in-windows-forms
(2) 反過來在 WPF 中裝載 Windows Forms 控制項
https://docs.microsoft.com/zh-tw/dotnet/framework/wpf/advanced/walkthrough-hosting-a-windows-forms-control-in-wpf

me1237guy 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。