checkbox_rectangle = new Rectangle(text_rectangle.X, text_rectangle.Y, checkmark_size, checkmark_size);
text_format = new StringFormat();
- text_format.Alignment=StringAlignment.Near;
- text_format.LineAlignment=StringAlignment.Center;
- text_format.HotkeyPrefix = HotkeyPrefix.Show;
+ text_format.Alignment = StringAlignment.Near;
+ text_format.LineAlignment = StringAlignment.Center;
+ if (checkbox.ShowKeyboardCuesInternal)
+ text_format.HotkeyPrefix = HotkeyPrefix.Show;
+ else
+ text_format.HotkeyPrefix = HotkeyPrefix.Hide;
/* Calculate the position of text and checkbox rectangle */
if (checkbox.appearance!=Appearance.Button) {
// adjustments to get the check-mark at the right place
rect.X ++; rect.Y ++;
// following logic is taken from DrawFrameControl method
+ int x_offset = rect.Width / 5;
+ int y_offset = rect.Height / 3;
for (int i = 0; i < check_wd; i++) {
- dc.DrawLine (check_pen, rect.Left + check_wd / 2,
- rect.Top + check_wd + i,
- rect.Left + check_wd / 2 + 2 * scale,
- rect.Top + check_wd + 2 * scale + i);
+ dc.DrawLine (check_pen, rect.Left + x_offset,
+ rect.Top + y_offset + i,
+ rect.Left + x_offset + 2 * scale,
+ rect.Top + y_offset + 2 * scale + i);
dc.DrawLine (check_pen,
- rect.Left + check_wd / 2 + 2 * scale,
- rect.Top + check_wd + 2 * scale + i,
- rect.Left + check_wd / 2 + 6 * scale,
- rect.Top + check_wd - 2 * scale + i);
+ rect.Left + x_offset + 2 * scale,
+ rect.Top + y_offset + 2 * scale + i,
+ rect.Left + x_offset + 6 * scale,
+ rect.Top + y_offset - 2 * scale + i);
}
}
}
StringFormat format = new StringFormat ();
format.Trimming = StringTrimming.EllipsisCharacter;
format.LineAlignment = StringAlignment.Center;
- format.HotkeyPrefix = MenuAccessKeysUnderlined ? HotkeyPrefix.Show : HotkeyPrefix.Hide;
+ if (control.ShowKeyboardCuesInternal)
+ format.HotkeyPrefix = HotkeyPrefix.Show;
+ else
+ format.HotkeyPrefix = HotkeyPrefix.Hide;
+
if (control.TextAlign == ToolBarTextAlign.Underneath)
format.Alignment = StringAlignment.Center;
else