GrapeCity SPREAD for Windows Forms 11.0J
PictureMargin プロパティ (ElementControl)


テキストとピクチャの間の余白を取得または設定します。
構文
'Declaration
 
Public Overridable Property PictureMargin As Integer
'使用法
 
Dim instance As ElementControl
Dim value As Integer
 
instance.PictureMargin = value
 
value = instance.PictureMargin
public virtual int PictureMargin {get; set;}

プロパティ値

ピクチャの余白(ピクセル単位)を表すInteger
解説

このプロパティは、コントロールのピクチャとテキストの間の余白を指定するときに使用します。表示するピクチャを指定するには、Pictureプロパティを設定します。

ピクチャの位置を操作するには、MarginTopMarginBottomMarginLeftMarginRightの各プロパティを設定します。これらのプロパティは、ピクチャの端とコントロールの端との間にスペースを空けます。

コントロールの内容の配置を指定するには、AlignHorzプロパティとAlignVertプロパティを使用します。

control.Picture = Image.FromFile(Application.StartupPath + "\\smokes.bmp");
control.PictureMargin = 34;
control.MarginTop = 3;
control.MarginBottom = 3;
control.MarginLeft = 3;
control.MarginRight = 3;
control.PictureOrientation = FarPoint.Win.PictureOrientation.PictureRotate180;
control.AlignText = FarPoint.Win.TextAlign.TextLeftPictRight;
control.AlignHorz = FarPoint.Win.HorizontalAlignment.Left;
control.BackColor = Color.Red;
control.Text = "NO SMOKING";
private void button1_Click(object sender, System.EventArgs e)
{
// Turn off the No Smoking sign
control.Visible=false;
}
control.Picture = Image.FromFile(Application.StartupPath & "\smokes.bmp")
control.PictureMargin = 34
control.MarginTop = 3
control.MarginBottom = 3
control.MarginLeft = 3
control.MarginRight = 3
control.PictureOrientation = FarPoint.Win.PictureOrientation.PictureRotate180
control.MarginTop = 3
control.MarginBottom = 3
control.AlignText = FarPoint.Win.TextAlign.TextLeftPictRight
control.AlignHorz = FarPoint.Win.HorizontalAlignment.Left
control.BackColor = Color.Red
control.Text = "NO SMOKING"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Turn off the NO Smoking sign
control.Visible = False
End Sub
参照

ElementControl クラス
ElementControl メンバ
AlignHorz プロパティ
AlignVert プロパティ
Picture プロパティ
MarginBottom プロパティ
MarginLeft プロパティ
MarginRight プロパティ
MarginTop プロパティ

 

 


© 2004-2018, GrapeCity Inc. All rights reserved.