質問編集履歴
1
コードの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -22,7 +22,80 @@
|
|
22
22
|
半透明になってしまう。
|
23
23
|
|
24
24
|
|
25
|
+
### サンプルコード
|
26
|
+
``` powershell
|
27
|
+
using namespace System.Windows.Forms
|
28
|
+
using namespace System.Drawing
|
25
29
|
|
30
|
+
|
31
|
+
$_Get_Form = {
|
32
|
+
#フォームの作成
|
33
|
+
$FormWed = 600
|
34
|
+
$FormlHei = 300
|
35
|
+
$Form = [Form]::new()
|
36
|
+
$Form.Size = [Size]::new($FormWed, $FormlHei)
|
37
|
+
$Form.Text = "Test"
|
38
|
+
|
39
|
+
#データグリッドビューの作成
|
40
|
+
$ListCount = 2
|
41
|
+
$Script:List = 1..$ListCount | foreach { [DataGridView]::new() }
|
42
|
+
$ListName = @('test1', 'test2')
|
43
|
+
for ($i = 0; $i -lt $ListCount; $i++)
|
44
|
+
{
|
45
|
+
$List[$i].AutoSizeColumnsMode = [DataGridViewAutoSizeColumnsMode]::AllCells
|
46
|
+
$List[$i].AutoSizeRowsMode = [DataGridViewAutoSizeRowsMode]::AllCells
|
47
|
+
$List[$i].Name = "List_$($ListName[$i])"
|
48
|
+
$List[$i].Dock = [DockStyle]::Fill
|
49
|
+
}
|
50
|
+
$List[0].Add_SelectionChanged($_ListNowUp)
|
51
|
+
$List[0].MultiSelect = $false
|
52
|
+
#$List[1].Columns[0].DefaultCellStyle.WrapMode = [DataGridViewTriState]::True
|
53
|
+
|
54
|
+
$SplitContainer = [SplitContainer]::new()
|
55
|
+
$SplitContainer.Panel1.Controls.Add($List[0])
|
56
|
+
$SplitContainer.Panel2.Controls.Add($List[1])
|
57
|
+
$SplitContainer.Name = "SplitContainer_1"
|
58
|
+
$Form.Controls.Add($SplitContainer)
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
$Form.Add_Activated({
|
63
|
+
$Form.TopMost = $True
|
64
|
+
})
|
65
|
+
}
|
66
|
+
|
67
|
+
$_Form_Semitransparent = {
|
68
|
+
$_Fm= $Form
|
69
|
+
$_Fm.Opacity = 0.1
|
70
|
+
}
|
71
|
+
|
72
|
+
$_Form_Opacity = {
|
73
|
+
$_Fm= $Form
|
74
|
+
$_Fm.Opacity = 1
|
75
|
+
}
|
76
|
+
|
77
|
+
$_AllControls = {
|
78
|
+
|
79
|
+
param([Control]$Control)
|
80
|
+
|
81
|
+
$Control.Controls | foreach {
|
82
|
+
$($_AllControls.Invoke($_))
|
83
|
+
}
|
84
|
+
$Control
|
85
|
+
}
|
86
|
+
|
87
|
+
.$_Get_Form
|
88
|
+
$($_AllControls.Invoke($Form)) | foreach {
|
89
|
+
$_."Add_MouseEnter"($_Form_Opacity)
|
90
|
+
$_."Add_MouseLeave"($_Form_Semitransparent)
|
91
|
+
}
|
92
|
+
|
93
|
+
$Form.ShowDialog()
|
94
|
+
|
95
|
+
|
96
|
+
```
|
97
|
+
|
98
|
+
|
26
99
|
### 補足情報
|
27
100
|
|
28
101
|
Win10
|