Reports for WinForms
背景の塗りつぶしブラシを設定する

RenderObject.Style.Brushプロパティを設定します。

実行例


サンプルコード(VB)
コードのコピー
' 背景の塗りつぶしブラシをグラデーションブラシに設定します。
texts(0).Text = "グラデーションブラシ"
texts(0).Style.Brush = New LinearGradientBrush(Point.Empty, New Point(1, 1), Color.Blue, Color.LightBlue)

' 背景の塗りつぶしブラシをハッチブラシに設定します。
texts(1).Text = "ハッチブラシ"
texts(1).Style.Brush = New HatchBrush(HatchStyle.Cross, Color.Blue, Color.LightBlue)

' 背景の塗りつぶしブラシをテクスチャブラシに設定します。
texts(2).Text = "テクスチャブラシ"
texts(2).Style.Brush = New TextureBrush(Image.FromFile("Image1.png"))
サンプルコード(C#)
コードのコピー
// 背景の塗りつぶしブラシをグラデーションブラシに設定します。
texts[0].Text = "グラデーションブラシ";
texts[0].Style.Brush = new LinearGradientBrush(Point.Empty, new Point(1, 1), Color.Blue, Color.LightBlue);

// 背景の塗りつぶしブラシをハッチブラシに設定します。
texts[1].Text = "ハッチブラシ";
texts[1].Style.Brush = new HatchBrush(HatchStyle.Cross, Color.Blue, Color.LightBlue);

// 背景の塗りつぶしブラシをテクスチャブラシに設定します。
texts[2].Text = "テクスチャブラシ";
texts[2].Style.Brush = new TextureBrush(Image.FromFile("Image1.png"));
関連トピック