Bagikan melalui


AmbientTheme.GlyphSize Properti

Definisi

Mendapatkan tinggi sekitar dan lebar glyph pada permukaan desain alur kerja.

public:
 virtual property System::Drawing::Size GlyphSize { System::Drawing::Size get(); };
[System.ComponentModel.Browsable(false)]
public virtual System.Drawing.Size GlyphSize { get; }
[<System.ComponentModel.Browsable(false)>]
member this.GlyphSize : System.Drawing.Size
Public Overridable ReadOnly Property GlyphSize As Size

Nilai Properti

Size Nilai yang mewakili tinggi sekitar dan lebar glef pada permukaan desain alur kerja.

Atribut

Contoh

Contoh kode berikut menunjukkan cara umum Anda dapat mengakses GlyphSize properti dari kelas yang berasal dari DesignerGlyph kelas .

Contoh kode ini adalah bagian dari Sampel SDK Monitor Alur Kerja dari file DatabaseService.cs. Untuk informasi selengkapnya, lihat Pemantauan Alur Kerja.

public override Rectangle GetBounds(ActivityDesigner designer, bool activated)
{
    Rectangle imageBounds = Rectangle.Empty;
    Image image = Resources.Executing;
    if (image != null)
    {
        Size glyphSize = WorkflowTheme.CurrentTheme.AmbientTheme.GlyphSize;
        imageBounds.Location = new Point(designer.Bounds.Right - glyphSize.Width / 2, designer.Bounds.Top - glyphSize.Height / 2);
        imageBounds.Size = glyphSize;
    }
    return imageBounds;
}
Public Overrides Function GetBounds(ByVal designer As System.Workflow.ComponentModel.Design.ActivityDesigner, ByVal activated As Boolean) As System.Drawing.Rectangle
    Dim imageBounds As Rectangle = Rectangle.Empty
    Dim image As Image = AppResources.Executing
    If Not image Is Nothing Then
        Dim glyphSize As Size = WorkflowTheme.CurrentTheme.AmbientTheme.GlyphSize
        imageBounds.Location = New Point(designer.Bounds.Right - glyphSize.Width / 2, designer.Bounds.Top - glyphSize.Height / 2)
        imageBounds.Size = glyphSize
    End If
    Return imageBounds
End Function

Berlaku untuk

Lihat juga