コード例 #1
0
        public override void Draw(IDrawingGraphics drawingGraphics)
        {
            drawingGraphics.Style(this.Style);

            switch (this.AutoSizeMode)
            {
                case AutoSizeModeOptions.None:
                case AutoSizeModeOptions.Left:
                case AutoSizeModeOptions.OneLineAutoHeight:
                    drawingGraphics.DrawText(this.text);
                    break;
                case AutoSizeModeOptions.WrapText:
                    drawingGraphics.DrawMultiLineText(this.text, this.Size.Width, this.Size.Height);
                    break;
                case AutoSizeModeOptions.Center:
                    drawingGraphics.DrawCenterText(this.text,this.Size.Width);
                    break;
                case AutoSizeModeOptions.Right:
                    drawingGraphics.DrawRightText(this.text);
                    break;

            }
        }