teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

見づらいとのご指摘通り、修正させていただきました。

2021/01/09 07:59

投稿

dawan
dawan

スコア0

title CHANGED
File without changes
body CHANGED
@@ -9,17 +9,21 @@
9
9
  網目は背景、フォーム3つが重なり、右側と下側に影が落ちてる。
10
10
 
11
11
  ### 該当のソースコード
12
+ ```
12
13
  panel.Control.Add(new CostomControl(){Location = new Point(30, 30)});
13
14
  panel.Control.Add(new CostomControl(){Location = new Point(60, 60)});
14
15
  panel.Control.Add(new CostomControl(){Location = new Point(90, 90)});
16
+ ```
15
17
  という感じの状態。
16
-
18
+ ```
17
19
  public class CostomControl : Panel
20
+ ```
18
21
  背景Bitmapはbackground[]に格納
19
22
  コンストラクタにて
20
23
  Paint += CostomControl_Paint;
21
24
 
22
25
  影描画部分 (下側/右下/右側/パネル)
26
+ ```
23
27
  private void CostomControl_Paint(object sender, PaintEventArgs e)
24
28
  {
25
29
  Graphics g = e.Graphics;
@@ -40,7 +44,7 @@
40
44
  }
41
45
  g.FillRectangle(new SolidBrush(Color.FromArgb(255, 47, 47, 47)), new Rectangle(0, 0, Width - background[2].Width, Height - background[0].Height));
42
46
  }
43
-
47
+ ```
44
48
  ### 試したこと
45
49
 
46
50
  doublebufferをしていたので回避してみたり