System.Windows.Forms.CustomTabControl.GetStringFormat C# (CSharp) Method

GetStringFormat() private method

private GetStringFormat ( ) : StringFormat
return System.Drawing.StringFormat
        private StringFormat GetStringFormat()
        {
            StringFormat format = null;

            //	Rotate Text by 90 degrees for left and right tabs
            switch (this.Alignment) {
                case TabAlignment.Top:
                case TabAlignment.Bottom:
                    format = new StringFormat();
                    break;
                case TabAlignment.Left:
                case TabAlignment.Right:
                    format = new StringFormat(StringFormatFlags.DirectionVertical);
                    break;
            }
            format.Alignment = StringAlignment.Center;
            format.LineAlignment = StringAlignment.Center;
            if (this.FindForm() != null && this.FindForm().KeyPreview){
                format.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show;
            } else {
                format.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Hide;
            }
            if (this.RightToLeft == RightToLeft.Yes){
                format.FormatFlags = format.FormatFlags | StringFormatFlags.DirectionRightToLeft;
            }
            return format;
        }