DashStyle 列挙体とは? わかりやすく解説

DashStyle 列挙体

Pen オブジェクト描画する破線スタイル指定します

名前空間: System.Drawing.Drawing2D
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

メンバメンバ
使用例使用例

DashStyle 列挙体を使用してペン作成し、DashStyle プロパティ設定するコード例次に示します

この例は、Windows フォームでの使用意図してデザインされています。Button3 という名前の Button格納するフォーム作成しますコードフォーム貼り付けButton3_Click メソッドボタンClick イベント関連付けます。

Private Sub Button3_Click(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 Button3.Click

    Dim buttonGraphics As Graphics = Button3.CreateGraphics()
    Dim myPen As Pen = New
 Pen(Color.ForestGreen, 4.0F)
    myPen.DashStyle = Drawing2D.DashStyle.DashDotDot

    Dim theRectangle As Rectangle = Button3.ClientRectangle
    theRectangle.Inflate(-2, -2)
    buttonGraphics.DrawRectangle(myPen, theRectangle)
    buttonGraphics.Dispose()
    myPen.Dispose()
End Sub
private void Button3_Click(System.Object sender,
 System.EventArgs e)
{

    Graphics buttonGraphics = Button3.CreateGraphics();
    Pen myPen = new Pen(Color.ForestGreen, 4.0F);
    myPen.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDotDot;

    Rectangle theRectangle = Button3.ClientRectangle;
    theRectangle.Inflate(-2, -2);
    buttonGraphics.DrawRectangle(myPen, theRectangle);
    buttonGraphics.Dispose();
    myPen.Dispose();
}
private:
   void Button3_Click( System::Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      Graphics^ buttonGraphics = Button3->CreateGraphics();
      Pen^ myPen = gcnew Pen( Color::ForestGreen,4.0F );
      myPen->DashStyle = System::Drawing::Drawing2D::DashStyle::DashDotDot;
      Rectangle theRectangle = Button3->ClientRectangle;
      theRectangle.Inflate(  -2, -2 );
      buttonGraphics->DrawRectangle( myPen, theRectangle );
      delete buttonGraphics;
      delete myPen;
   }
private void button3_Click(Object sender, System.EventArgs
 e)
{
    Graphics buttonGraphics = button3.CreateGraphics();
    Pen myPen = new Pen(Color.get_ForestGreen(), 4.0F);

    myPen.set_DashStyle(System.Drawing.Drawing2D.DashStyle.DashDotDot);

    Rectangle theRectangle = button3.get_ClientRectangle();

    theRectangle.Inflate(-2, -2);
    buttonGraphics.DrawRectangle(myPen, theRectangle);
    buttonGraphics.Dispose();
    myPen.Dispose();
} //button3_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.Drawing.Drawing2D 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DashStyle 列挙体」の関連用語

DashStyle 列挙体のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DashStyle 列挙体のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS