PowerTools SPREAD for Windows Forms 10.0J
SetBounds(Int32,Int32,Int32,Int32) メソッド


境界矩形の左上隅のX座標
境界矩形の左上隅のY座標
境界矩形の幅(ピクセル単位)
境界矩形の高さ(ピクセル単位)
オブジェクトの境界を、指定した位置とサイズに設定します。
構文
'Declaration
 
Public Overloads Overrides Sub SetBounds( _
   ByVal x As Integer, _
   ByVal y As Integer, _
   ByVal width As Integer, _
   ByVal height As Integer _
) 
'使用法
 
Dim instance As PSObject
Dim x As Integer
Dim y As Integer
Dim width As Integer
Dim height As Integer
 
instance.SetBounds(x, y, width, height)
public override void SetBounds( 
   int x,
   int y,
   int width,
   int height
)

パラメータ

x
境界矩形の左上隅のX座標
y
境界矩形の左上隅のY座標
width
境界矩形の幅(ピクセル単位)
height
境界矩形の高さ(ピクセル単位)
次のサンプルコードは、カスタムのPSObjectを作成します。
System.Drawing.Point[] pts = {new System.Drawing.Point(25, 0), 
                                new System.Drawing.Point(0, 50), 
                                new System.Drawing.Point(20, 50), 
                                new System.Drawing.Point((int)2.5, 100), 
                                new System.Drawing.Point(40, 40), 
                                new System.Drawing.Point(20, 40), 
                                new System.Drawing.Point(40, 0), 
                                new System.Drawing.Point(25, 0)};

System.Drawing.Drawing2D.GraphicsPath gpath = new System.Drawing.Drawing2D.GraphicsPath();
gpath.AddPolygon(pts);

FarPoint.Win.Spread.DrawingSpace.PSObject pso = new FarPoint.Win.Spread.DrawingSpace.CustomShape();
pso.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.HorizontalAndVertical;
pso.CanRotate = true;
pso.Shape = gpath;
pso.SetBounds(250, 250, 120, 120);
fpSpread1.ActiveSheet.AddShape(pso);
Dim pts As System.Drawing.Point() = {New System.Drawing.Point(25, 0),  _
                                New System.Drawing.Point(0, 50),  _
                                New System.Drawing.Point(20, 50),  _
                                New System.Drawing.Point(2.5, 100),  _
                                New System.Drawing.Point(40, 40),  _
                                New System.Drawing.Point(20, 40),  _
                                New System.Drawing.Point(40, 0),  _
                                New System.Drawing.Point(25, 0)}

Dim gpath As System.Drawing.Drawing2D.GraphicsPath = New System.Drawing.Drawing2D.GraphicsPath
gpath.AddPolygon(pts)

Dim pso As New FarPoint.Win.Spread.DrawingSpace.CustomShape
pso.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.HorizontalAndVertical
pso.CanRotate = True
pso.Shape = gpath
pso.SetBounds(250, 250, 120, 120)
FpSpread1.ActiveSheet.AddShape(pso)
参照

PSObject クラス
PSObject メンバ
オーバーロード一覧

 

 


© 2004-2017, GrapeCity inc. All rights reserved.