回答編集履歴
1
回答に追記
test
CHANGED
@@ -1 +1,69 @@
|
|
1
1
|
そのPictureBoxのParentプロパティにそのPanelを設定すればいいです
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
---
|
6
|
+
|
7
|
+
[Control.cs](https://referencesource.microsoft.com/#System.Windows.Forms)
|
8
|
+
|
9
|
+
```C#
|
10
|
+
|
11
|
+
public Control Parent {
|
12
|
+
|
13
|
+
get {
|
14
|
+
|
15
|
+
Debug.WriteLineIf(IntSecurity.SecurityDemand.TraceVerbose, "GetParent Demanded");
|
16
|
+
|
17
|
+
IntSecurity.GetParent.Demand();
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
return ParentInternal;
|
22
|
+
|
23
|
+
}
|
24
|
+
|
25
|
+
set {
|
26
|
+
|
27
|
+
ParentInternal = value;
|
28
|
+
|
29
|
+
}
|
30
|
+
|
31
|
+
}
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
// SECURITY WARNING: This property bypasses a security demand. Use with caution!
|
36
|
+
|
37
|
+
internal virtual Control ParentInternal {
|
38
|
+
|
39
|
+
get {
|
40
|
+
|
41
|
+
return parent;
|
42
|
+
|
43
|
+
}
|
44
|
+
|
45
|
+
set {
|
46
|
+
|
47
|
+
if (parent != value) {
|
48
|
+
|
49
|
+
if (value != null) {
|
50
|
+
|
51
|
+
value.Controls.Add(this);
|
52
|
+
|
53
|
+
}
|
54
|
+
|
55
|
+
else {
|
56
|
+
|
57
|
+
parent.Controls.Remove(this);
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
}
|
62
|
+
|
63
|
+
}
|
64
|
+
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
```
|