←Select platform

X Property

Summary

Gets or sets a value that represents the X coordinate for this LogicalPoint.

Syntax

C#
VB
C++
[DataMemberAttribute(Name="x", Order=0, IsRequired=true)] 
public double X { get; set; } 
  
Public Property X As Double 
public: 
property double X { 
   double get(); 
   void set (    double ); 
} 

Property Value

The x-coordinate of this LogicalPoint.

Example

This example converts the x and y from inch to pixels units.

C#
VB
using Leadtools.Forms; 
 
public void LogicalPoint_ConvertedXY() 
{ 
   // create a new logical point at location 1.5, 2 in inches 
   LogicalPoint pt = new LogicalPoint(1.5f, 2f, LogicalUnit.Inch); 
 
   string s; 
   // show the point 
   s = string.Format("Point is {0}", pt); 
   MessageBox.Show(s); 
 
   // show the x and y components converted to pixels 
   s = string.Format("x and y is {0}, {1} Pixels", LogicalUnitConverter.Convert(pt.X, 
                                                                                LogicalUnit.Inch, 
                                                                                150, 
                                                                                LogicalUnit.Pixel, 
                                                                                150), LogicalUnitConverter.ConvertToPixels(pt.Y, LogicalUnit.Inch, 150)); 
   MessageBox.Show(s); 
} 
Imports Leadtools.Forms 
 
Public Sub LogicalPoint_ConvertedXY() 
   ' create a new logical point at location 1.5, 2 in inches 
   Dim pt As LogicalPoint = New LogicalPoint(1.5F, 2.0F, LogicalUnit.Inch) 
 
   Dim s As String 
   ' show the point 
   s = String.Format("Point is {0}", pt) 
   MessageBox.Show(s) 
 
   ' show the x and y components converted to pixels 
   s = String.Format("x and y is {0}, {1} Pixels", LogicalUnitConverter.Convert(pt.X, LogicalUnit.Inch, 
                                                                                150, 
                                                                                LogicalUnit.Pixel, 150), 
                     LogicalUnitConverter.ConvertToPixels(pt.Y, LogicalUnit.Inch, 150)) 
   MessageBox.Show(s) 
End Sub 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Forms Assembly