Point.X プロパティとは? わかりやすく解説

Point.X プロパティ

この Pointx 座標取得または設定します

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

使用例使用例

op_Equality 演算子使用する方法と、Size または 2 つ整数から Point生成する方法次のコード例示しますまた、X プロパティと Y プロパティ使用方法示します。この例は、Windows フォームでの使用意図してデザインされています。Button1 という名前のボタン配置されているフォームコード貼り付けButton1_Click メソッドボタンClick イベント関連付けます。

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

    ' Construct a new Point with integers.
    Dim Point1 As New Point(100,
 100)

    ' Create a Graphics object.
    Dim formGraphics As Graphics = Me.CreateGraphics()

    ' Construct another Point, this time using a Size.
    Dim Point2 As New Point(New
 Size(100, 100))

    ' Call the equality operator to see if the points are equal,  
    ' and if so print out their x and y values.
    If (Point.op_Equality(Point1, Point2)) Then
        formGraphics.DrawString(String.Format("Point1.X:
 " & _
            "{0},Point2.X: {1}, Point1.Y: {2}, Point2.Y {3}",
 _
            New Object() {Point1.X, Point2.X,
 Point1.Y, Point2.Y}), _
            Me.Font, Brushes.Black, New PointF(10,
 70))
    End If

End Sub
private void Button1_Click(System.Object sender,
 System.EventArgs e)
{

    // Construct a new Point with integers.
    Point Point1 = new Point(100, 100);

    // Create a Graphics object.
    Graphics formGraphics = this.CreateGraphics();

    // Construct another Point, this time using a Size.
    Point Point2 = new Point(new Size(100,
 100));

    // Call the equality operator to see if the points are equal,  
    // and if so print out their x and y values.
    if (Point1 == Point2)
    {
        formGraphics.DrawString(String.Format("Point1.X: " +
            "{0},Point2.X: {1}, Point1.Y: {2}, Point2.Y {3}",
            new object[]{Point1.X, Point2.X, Point1.Y, Point2.Y})
,
            this.Font, Brushes.Black, new PointF(10,
 70));
    }

}
private:
   void Button1_Click( System::Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      // Construct a new Point with integers.
      Point Point1 = Point(100,100);

      // Create a Graphics object.
      Graphics^ formGraphics = this->CreateGraphics();

      // Construct another Point, this time using a Size.
      Point Point2 = Point(System::Drawing::Size( 100, 100 ));

      // Call the equality operator to see if the points are equal,
  
      // and if so print out their x and y values.
      if ( Point1 == Point2 )
      {
         array<Object^>^temp0 = {Point1.X,Point2.X,Point1.Y,Point2.Y};
         formGraphics->DrawString( String::Format( "Point1.X: "
         "{0},Point2.X: {1}, Point1.Y: {2}, Point2.Y {3}", temp0 ), this->Font,
 Brushes::Black, PointF(10,70) );
      }
   }
private void button1_Click(Object sender, System.EventArgs
 e)
{
    // Construct a new Point with integers.
    Point point1 = new Point(100, 100);

    // Create a Graphics object.
    Graphics formGraphics = this.CreateGraphics();

    // Construct another Point, this time using a Size.
    Point point2 = new Point(new Size(100,
 100));

    // Call the equality operator to see if the points are equal,  
    // and if so print out their x and y values.
    if (point1.Equals(point2)) {
        formGraphics.DrawString(String.Format("Point1.X: " 
            + "{0},Point2.X: {1}, Point1.Y: {2}, Point2.Y {3}", 
            new Object[] { new Integer(point1.get_X()),
 
            new Integer(point2.get_X()), new
 Integer(point1.get_Y()), 
            new Integer(point2.get_Y())    }), this.get_Font()
,
            Brushes.get_Black(), new PointF(10, 70));
    }
} //button1_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「Point.X プロパティ」の関連用語

Point.X プロパティのお隣キーワード
検索ランキング

   

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



Point.X プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS