質問編集履歴

1

ソースコードを追加しました。

2023/01/12 04:10

投稿

Yamato.dd
Yamato.dd

スコア48

test CHANGED
File without changes
test CHANGED
@@ -1,7 +1,7 @@
1
1
  ### 前提
2
2
 
3
3
  開発ツール:Visual Studio 2019
4
- 開発言語:C#、WPF(.Net Framework 4.8)
4
+ 開発言語:C#、WPF(.Net Framework 4.7)
5
5
  OS:Windows 10
6
6
 
7
7
  ### 実現したいこと
@@ -16,6 +16,30 @@
16
16
   「アイテム1」の文字を赤く、Check2にチェックが入っていたら「アイテム2」の文字を赤く、
17
17
   チェックが入っていなければ、文字の色を黒くしたいです。
18
18
 
19
+ まずはこのようなことが実現できるのかが知りたいです。
20
+
21
+ ### ソースコード
22
+ ```C#
23
+ // sample.xaml
24
+ <Window x:Class="Sample.MainWindow"
25
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
26
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
27
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
28
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
29
+ xmlns:local="clr-namespace:Sample"
30
+ mc:Ignorable="d"
31
+ Title="Sample" Height="150" Width="400">
32
+ <Grid>
33
+ <CheckBox Name="Check1" Content="Check1" HorizontalAlignment="Left" Height="21" Margin="250,20,0,0" VerticalAlignment="Top" Width="117"/>
34
+ <CheckBox Name="Check2" Content="Check2" HorizontalAlignment="Left" Height="21" Margin="250,40,0,0" VerticalAlignment="Top" Width="117"/>
35
+ <ComboBox Name="Combo1" HorizontalAlignment="Left" Margin="28,19,0,0" VerticalAlignment="Top" Width="120">
36
+ <ComboBoxItem Content="アイテム1"/>
37
+ <ComboBoxItem Content="アイテム2"/>
38
+ </ComboBox>
39
+ </Grid>
40
+ </Window>
41
+ ```
42
+
19
43
  宜しくお願いいたします。
20
44
 
21
45