回答編集履歴
1
解決内容の詳細
test
CHANGED
@@ -1,3 +1,77 @@
|
|
1
1
|
gotfocusを使用することで解決しました
|
2
2
|
|
3
3
|
Zuishinさんありがとうございました
|
4
|
+
|
5
|
+
```xaml
|
6
|
+
|
7
|
+
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="74" VerticalAlignment="Top" Width="199" Margin="275,101,0,0">
|
8
|
+
|
9
|
+
<TextBox GotFocus="sX_GotFocus" FocusableChanged="sX_FocusableChanged" x:Name="sX" TextWrapping="Wrap" FontSize="48" Margin="-1,-1,1,1"/>
|
10
|
+
|
11
|
+
</Border>
|
12
|
+
|
13
|
+
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="74" VerticalAlignment="Top" Width="199" Margin="275,240,0,0">
|
14
|
+
|
15
|
+
<TextBox GotFocus="sY_GotFocus" FocusableChanged="sY_FocusableChanged" x:Name="sY" TextWrapping="Wrap" FontSize="48" Margin="-1,1,1,-1"/>
|
16
|
+
|
17
|
+
</Border>
|
18
|
+
|
19
|
+
```
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
```c#
|
24
|
+
|
25
|
+
private void sX_GotFocus(object sender, RoutedEventArgs e)
|
26
|
+
|
27
|
+
{
|
28
|
+
|
29
|
+
nowtext = 1;
|
30
|
+
|
31
|
+
}
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
private void sY_GotFocus(object sender, RoutedEventArgs e)
|
36
|
+
|
37
|
+
{
|
38
|
+
|
39
|
+
nowtext = 2;
|
40
|
+
|
41
|
+
}
|
42
|
+
|
43
|
+
```
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
Gotfocusを使用してtextboxにフォーカスがあったときに変数を変え、その変数によって制御することで実現しました。
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
```c#
|
52
|
+
|
53
|
+
private void Nine_Click(object sender, RoutedEventArgs e)
|
54
|
+
|
55
|
+
{
|
56
|
+
|
57
|
+
if (nowtext == 1)
|
58
|
+
|
59
|
+
{
|
60
|
+
|
61
|
+
sX.AppendText(""+9);
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
}
|
66
|
+
|
67
|
+
if (nowtext == 2)
|
68
|
+
|
69
|
+
{
|
70
|
+
|
71
|
+
sY.AppendText("" + 9);
|
72
|
+
|
73
|
+
}
|
74
|
+
|
75
|
+
}
|
76
|
+
|
77
|
+
```
|