コード例 #1
0
 public virtual TextFormatFlags GetTextFormatFlags(DropDownButton button)
 {
     TextFormatFlags tff = TextFormatFlags.Default;
     switch (button.TextAlign)
     {
         case System.Drawing.ContentAlignment.TopCenter:
             tff = TextFormatFlags.HorizontalCenter;
             break;
         case System.Drawing.ContentAlignment.TopRight:
             tff = TextFormatFlags.Right;
             break;
         case System.Drawing.ContentAlignment.MiddleLeft:
             tff = TextFormatFlags.VerticalCenter;
             break;
         case System.Drawing.ContentAlignment.MiddleCenter:
             tff = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter;
             break;
         case System.Drawing.ContentAlignment.MiddleRight:
             tff = TextFormatFlags.VerticalCenter | TextFormatFlags.Right;
             break;
         case System.Drawing.ContentAlignment.BottomLeft:
             tff = TextFormatFlags.Bottom;
             break;
         case System.Drawing.ContentAlignment.BottomCenter:
             tff = TextFormatFlags.Bottom | TextFormatFlags.HorizontalCenter;
             break;
         case System.Drawing.ContentAlignment.BottomRight:
             tff = TextFormatFlags.Bottom | TextFormatFlags.Right;
             break;
     }
     return tff;
 }
コード例 #2
0
 public virtual Rectangle GetDropDownButtonBounds(DropDownButton button)
 {
     return new Rectangle(button.ClientSize.Width - 20, 0, 20, button.ClientSize.Height);
 }