FarPoint.Win アセンブリ > FarPoint.Win 名前空間 > ElementControl クラス : PictureMargin プロパティ |
'Declaration
Public Overridable Property PictureMargin As Integer
public virtual int PictureMargin {get; set;}
このプロパティは、コントロールのピクチャとテキストの間の余白を指定するときに使用します。表示するピクチャを指定するには、Pictureプロパティを設定します。
ピクチャの位置を操作するには、MarginTop、MarginBottom、MarginLeft、MarginRightの各プロパティを設定します。これらのプロパティは、ピクチャの端とコントロールの端との間にスペースを空けます。
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