質問編集履歴

1

コードの追加

2019/01/12 05:09

投稿

kamikazelight
kamikazelight

スコア305

test CHANGED
File without changes
test CHANGED
@@ -46,6 +46,152 @@
46
46
 
47
47
 
48
48
 
49
+ ### サンプルコード
50
+
51
+ ``` powershell
52
+
53
+ using namespace System.Windows.Forms
54
+
55
+ using namespace System.Drawing
56
+
57
+
58
+
59
+
60
+
61
+ $_Get_Form = {
62
+
63
+ #フォームの作成
64
+
65
+ $FormWed = 600
66
+
67
+ $FormlHei = 300
68
+
69
+ $Form = [Form]::new()
70
+
71
+ $Form.Size = [Size]::new($FormWed, $FormlHei)
72
+
73
+ $Form.Text = "Test"
74
+
75
+
76
+
77
+ #データグリッドビューの作成
78
+
79
+ $ListCount = 2
80
+
81
+ $Script:List = 1..$ListCount | foreach { [DataGridView]::new() }
82
+
83
+ $ListName = @('test1', 'test2')
84
+
85
+ for ($i = 0; $i -lt $ListCount; $i++)
86
+
87
+ {
88
+
89
+ $List[$i].AutoSizeColumnsMode = [DataGridViewAutoSizeColumnsMode]::AllCells
90
+
91
+ $List[$i].AutoSizeRowsMode = [DataGridViewAutoSizeRowsMode]::AllCells
92
+
93
+ $List[$i].Name = "List_$($ListName[$i])"
94
+
95
+ $List[$i].Dock = [DockStyle]::Fill
96
+
97
+ }
98
+
99
+ $List[0].Add_SelectionChanged($_ListNowUp)
100
+
101
+ $List[0].MultiSelect = $false
102
+
103
+ #$List[1].Columns[0].DefaultCellStyle.WrapMode = [DataGridViewTriState]::True
104
+
105
+
106
+
107
+ $SplitContainer = [SplitContainer]::new()
108
+
109
+ $SplitContainer.Panel1.Controls.Add($List[0])
110
+
111
+ $SplitContainer.Panel2.Controls.Add($List[1])
112
+
113
+ $SplitContainer.Name = "SplitContainer_1"
114
+
115
+ $Form.Controls.Add($SplitContainer)
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ $Form.Add_Activated({
124
+
125
+ $Form.TopMost = $True
126
+
127
+ })
128
+
129
+ }
130
+
131
+
132
+
133
+ $_Form_Semitransparent = {
134
+
135
+ $_Fm= $Form
136
+
137
+ $_Fm.Opacity = 0.1
138
+
139
+ }
140
+
141
+
142
+
143
+ $_Form_Opacity = {
144
+
145
+ $_Fm= $Form
146
+
147
+ $_Fm.Opacity = 1
148
+
149
+ }
150
+
151
+
152
+
153
+ $_AllControls = {
154
+
155
+
156
+
157
+ param([Control]$Control)
158
+
159
+
160
+
161
+ $Control.Controls | foreach {
162
+
163
+ $($_AllControls.Invoke($_))
164
+
165
+ }
166
+
167
+ $Control
168
+
169
+ }
170
+
171
+
172
+
173
+ .$_Get_Form
174
+
175
+ $($_AllControls.Invoke($Form)) | foreach {
176
+
177
+ $_."Add_MouseEnter"($_Form_Opacity)
178
+
179
+ $_."Add_MouseLeave"($_Form_Semitransparent)
180
+
181
+ }
182
+
183
+
184
+
185
+ $Form.ShowDialog()
186
+
187
+
188
+
189
+
190
+
191
+ ```
192
+
193
+
194
+
49
195
 
50
196
 
51
197
  ### 補足情報