回答編集履歴

1

見直しキャンペーン中

2023/07/22 07:22

投稿

TN8001
TN8001

スコア9401

test CHANGED
@@ -1,279 +1,140 @@
1
1
  `<Grid MinWidth="1320" MinHeight="390">`が原因です。
2
-
3
2
  1320より小さくならないので`Grid`内にいるボタン類が`Window`外にはみ出ます。
4
3
 
5
-
6
-
7
4
  試行錯誤されてxamlに混乱が見られたので、整理させていただきました。
8
-
9
5
  余計なお世話だったらすいません^^;
10
6
 
11
-
12
-
13
- ```xaml
7
+ ```xml
14
-
15
8
  <Window
16
-
17
9
  x:Class="WpfApp2.MainWindow"
18
-
19
10
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
20
-
21
11
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
22
-
23
12
  xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
24
-
25
13
  Title="MainWindow"
26
-
27
14
  Width="1320"
28
-
29
15
  Height="390"
30
-
31
16
  AllowsTransparency="True"
32
-
33
17
  Background="{x:Null}"
34
-
35
18
  Foreground="DarkGray"
36
-
37
19
  ResizeMode="CanResizeWithGrip"
38
-
39
20
  WindowStartupLocation="CenterScreen"
40
-
41
21
  WindowStyle="None">
42
-
43
22
  <Window.Resources>
44
-
45
23
  <Style x:Key="WindowButtonStyle" TargetType="Button">
46
-
47
24
  <Setter Property="Width" Value="30" />
48
-
49
25
  <Setter Property="Height" Value="30" />
50
-
51
26
  <Setter Property="Margin" Value="0,0,0,0" />
52
-
53
27
  <Setter Property="Background" Value="Transparent" />
54
-
55
28
  <Setter Property="BorderBrush" Value="Transparent" />
56
-
57
29
  <Setter Property="BorderThickness" Value="0" />
58
-
59
30
  </Style>
60
-
61
31
  </Window.Resources>
62
-
63
32
  <Border
64
-
65
33
  Background="Green"
66
-
67
34
  BorderThickness="1.5"
68
-
69
35
  CornerRadius="10">
70
-
71
36
  <Grid>
72
-
73
37
  <Grid.RowDefinitions>
74
-
75
38
  <RowDefinition Height="Auto" />
76
-
77
39
  <RowDefinition />
78
-
79
40
  </Grid.RowDefinitions>
80
-
81
41
  <StackPanel
82
-
83
42
  HorizontalAlignment="Right"
84
-
85
43
  VerticalAlignment="Top"
86
-
87
44
  Orientation="Horizontal"
88
-
89
45
  ZIndex="4">
90
-
91
46
  <Button
92
-
93
47
  Content="〇"
94
-
95
48
  Foreground="DarkGray"
96
-
97
49
  Style="{StaticResource WindowButtonStyle}" />
98
-
99
50
  <Button
100
-
101
51
  Content="-"
102
-
103
52
  Foreground="DarkGray"
104
-
105
53
  Style="{StaticResource WindowButtonStyle}" />
106
-
107
54
  <Button
108
-
109
55
  Padding="0"
110
-
111
56
  Content="△"
112
-
113
57
  Cursor="Hand"
114
-
115
58
  Style="{StaticResource WindowButtonStyle}" />
116
-
117
59
  <Button
118
-
119
60
  Padding="0"
120
-
121
61
  Content="×"
122
-
123
62
  Cursor="Hand"
124
-
125
63
  Style="{StaticResource WindowButtonStyle}" />
126
-
127
64
  </StackPanel>
128
-
129
65
  <Border
130
-
131
66
  Margin="0,2.5"
132
-
133
67
  VerticalAlignment="Top"
134
-
135
68
  Background="Blue"
136
-
137
69
  BorderThickness="1.5"
138
-
139
70
  CornerRadius="10">
140
-
141
71
  <StackPanel Orientation="Horizontal">
142
-
143
72
  <Image
144
-
145
73
  Width="65"
146
-
147
74
  Height="65"
148
-
149
75
  Margin="8,0,0,0" />
150
-
151
76
  <ListView
152
-
153
77
  x:Name="ListViewMenu"
154
-
155
78
  Height="60"
156
-
157
79
  VerticalAlignment="Top"
158
-
159
80
  Background="{x:Null}"
160
-
161
81
  Cursor="Hand"
162
-
163
82
  FontFamily="Arial"
164
-
165
83
  FontSize="14"
166
-
167
84
  FontWeight="Bold"
168
-
169
85
  Foreground="#FFBBB6B6"
170
-
171
86
  ScrollViewer.VerticalScrollBarVisibility="Disabled">
172
-
173
87
  <ListView.ItemContainerStyle>
174
-
175
88
  <Style TargetType="ListViewItem">
176
-
177
89
  <Setter Property="Template">
178
-
179
90
  <Setter.Value>
180
-
181
91
  <ControlTemplate TargetType="ListViewItem">
182
-
183
92
  <Border Background="Transparent">
184
-
185
93
  <ContentPresenter
186
-
187
94
  Margin="20,0"
188
-
189
95
  HorizontalAlignment="Center"
190
-
191
96
  VerticalAlignment="Center" />
192
-
193
97
  </Border>
194
-
195
98
  </ControlTemplate>
196
-
197
99
  </Setter.Value>
198
-
199
100
  </Setter>
200
-
201
101
  </Style>
202
-
203
102
  </ListView.ItemContainerStyle>
204
-
205
103
  <ListBox.ItemsPanel>
206
-
207
104
  <ItemsPanelTemplate>
208
-
209
105
  <StackPanel Orientation="Horizontal" />
210
-
211
106
  </ItemsPanelTemplate>
212
-
213
107
  </ListBox.ItemsPanel>
214
-
215
108
  <ListViewItem Name="Dash" Uid="0">
216
-
217
109
  <TextBlock Text="aaaa" />
218
-
219
110
  </ListViewItem>
220
-
221
111
  <ListViewItem Uid="1">
222
-
223
112
  <TextBlock Text="bbbb" />
224
-
225
113
  </ListViewItem>
226
-
227
114
  <ListViewItem Uid="2">
228
-
229
115
  <TextBlock Text="cccc" />
230
-
231
116
  </ListViewItem>
232
-
233
117
  <ListViewItem Uid="4">
234
-
235
118
  <TextBlock Text="dddd" />
236
-
237
119
  </ListViewItem>
238
-
239
120
  <ListViewItem Uid="6">
240
-
241
121
  <TextBlock Text="fffff" />
242
-
243
122
  </ListViewItem>
244
-
245
123
  <ListViewItem Uid="5">
246
-
247
124
  <TextBlock Text="eeeee" />
248
-
249
125
  </ListViewItem>
250
-
251
126
  <ListViewItem Uid="7">
252
-
253
127
  <TextBlock Text="gggg" />
254
-
255
128
  </ListViewItem>
256
-
257
129
  </ListView>
258
-
259
130
  </StackPanel>
260
-
261
131
  </Border>
262
-
263
132
  <Frame
264
-
265
133
  x:Name="Frame"
266
-
267
134
  Grid.Row="1"
268
-
269
135
  Foreground="{x:Null}"
270
-
271
136
  NavigationUIVisibility="Hidden" />
272
-
273
137
  </Grid>
274
-
275
138
  </Border>
276
-
277
139
  </Window>
278
-
279
140
  ```