PowerTools SPREAD for Windows Forms 10.0J
DrawFocusRectangle プロパティ (PSObject)


要素のフォーカス矩形の描画スタイルを取得または設定します。
構文
'Declaration
 
Public Overrides Property DrawFocusRectangle As DrawFocusRectangle
'使用法
 
Dim instance As PSObject
Dim value As DrawFocusRectangle
 
instance.DrawFocusRectangle = value
 
value = instance.DrawFocusRectangle
public override DrawFocusRectangle DrawFocusRectangle {get; set;}

プロパティ値

フォーカス矩形の表示と位置を決定するDrawFocusRectangle設定
解説
このプロパティが使用できるのは実行時のみです。
次のサンプル コードでは、このプロパティを継承するクラスでのプロパティの使用方法を示すために、このプロパティを使用してシェイプをカスタマイズしています。
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.PSGradient psg = new FarPoint.Win.Spread.DrawingSpace.PSGradient(); 
psg.Style = FarPoint.Win.Spread.DrawingSpace.GradientStyle.RadialIntoCenter; 
psg.Sections[0].Color = Color.Navy; 
psg.Sections[0].AlphaBlend = 128; 
psg.Sections[1].Color = Color.Magenta; 
psg.Sections[1].AlphaBlend = 255;

Point pt = new Point(150, 60); 

FarPoint.Win.Spread.DrawingSpace.PSShape pso = new FarPoint.Win.Spread.DrawingSpace.CustomShape(); 
pso.AlignHorz = Win.HorizontalAlignment.Center;
pso.AlignText = Win.TextAlign.TextBottomPictTop;
pso.AlignVert = Win.VerticalAlignment.Center;
pso.AllowBackgroundImageRotation = true;
pso.AlphaBlendBackColor = 75
pso.Anchor = 10
pso.BackColor = Color.Black;
pso.BackgroundImage = new FarPoint.Win.Picture(Image.FromFile("c:\\earth.ico"))
pso.BackgroundImageRotationAngle = 25;
pso.CanFocus = true
pso.CanMove = DrawingSpace.Moving.HorizontalAndVertical;
pso.CanPrint = true;
pso.CanRotate = true;
pso.CanSize = DrawingSpace.Sizing.HeightAndWidth;
pso.DrawFocusRectangle = Win.DrawFocusRectangle.Default;
pso.Enabled = true;
pso.Gradient = psg;
pso.Height = 50;
pso.Left = pt.X;
pso.Location = pt;
pso.Locked = false;
pso.MarginBottom = 10;
pso.MarginLeft = 10;
pso.MarginRight = 10;
pso.MarginTop = 10;
pso.PictureMargin = 10;
pso.PictureOrientation = Win.PictureOrientation.PictureRotateNone;
pso.PictureRotationAngle = 25;
pso.PictureTransparencyColor = Color.Blue;
pso.RotationAngle = 2;5
pso.Shape = gpath;
pso.ShapeOutlineColor = Color.Crimson;
pso.ShapeOutlineStyle = Drawing2D.DashStyle.Solid;
pso.ShapeOutlineThickness = 3;
pso.Size = new Size(30, 30);
pso.SizeProportional = true;
pso.Tag = "MyShape";
pso.Text = "FarPoint";
pso.TextOrientation = Win.TextOrientation.TextHorizontal;
pso.TextRotationAngle = 25;
pso.TextWrap = false;
pso.Top = pt.X;
pso.Visible = true;
pso.Width = 50;
pso.SetBounds(25, 25, 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 psg As New FarPoint.Win.Spread.DrawingSpace.PSGradient
psg.Style = FarPoint.Win.Spread.DrawingSpace.GradientStyle.RadialIntoCenter
psg.Sections(0).Color = Color.Navy
psg.Sections(0).AlphaBlend = 128
psg.Sections(1).Color = Color.Magenta
psg.Sections(1).AlphaBlend = 255

Dim pt As New Point(150, 60)

Dim pso As FarPoint.Win.Spread.DrawingSpace.PSShape
pso = New FarPoint.Win.Spread.DrawingSpace.CustomShape
pso.AlignHorz = Win.HorizontalAlignment.Center
pso.AlignText = Win.TextAlign.TextBottomPictTop
pso.AlignVert = Win.VerticalAlignment.Center
pso.AllowBackgroundImageRotation = True
pso.AlphaBlendBackColor = 75
pso.Anchor = 10
pso.BackColor = Color.Black
pso.BackgroundImage = New FarPoint.Win.Picture(Image.FromFile("c:\earth.ico"))
pso.BackgroundImageRotationAngle = 25
pso.CanFocus = True
pso.CanMove = DrawingSpace.Moving.HorizontalAndVertical
pso.CanPrint = True
pso.CanRotate = True
pso.CanSize = DrawingSpace.Sizing.HeightAndWidth
pso.DrawFocusRectangle = Win.DrawFocusRectangle.Default
pso.Enabled = True
pso.Gradient = psg
pso.Height = 50
pso.Left = pt.X
pso.Location = pt
pso.Locked = False
pso.MarginBottom = 10
pso.MarginLeft = 10
pso.MarginRight = 10
pso.MarginTop = 10
pso.PictureMargin = 10
pso.PictureOrientation = Win.PictureOrientation.PictureRotateNone
pso.PictureRotationAngle = 25
pso.PictureTransparencyColor = Color.Blue
pso.RotationAngle = 25
pso.Shape = gpath
pso.ShapeOutlineColor = Color.Crimson
pso.ShapeOutlineStyle = Drawing2D.DashStyle.Solid
pso.ShapeOutlineThickness = 3
pso.Size = New Size(30, 30)
pso.SizeProportional = True
pso.Tag = "MyShape"
pso.Text = "FarPoint"
pso.TextOrientation = Win.TextOrientation.TextHorizontal
pso.TextRotationAngle = 25
pso.TextWrap = False
pso.Top = pt.X
pso.Visible = True
pso.Width = 50
pso.SetBounds(25, 25, 120, 120)
FpSpread1.ActiveSheet.AddShape(pso)
参照

PSObject クラス
PSObject メンバ

 

 


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