本文整理汇总了C#中System.Windows.Forms.Control.RtlTranslateContent方法的典型用法代码示例。如果您正苦于以下问题:C# Control.RtlTranslateContent方法的具体用法?C# Control.RtlTranslateContent怎么用?C# Control.RtlTranslateContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Control
的用法示例。
在下文中一共展示了Control.RtlTranslateContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTextFormatFlags
internal static TextFormatFlags CreateTextFormatFlags(Control ctl, System.Drawing.ContentAlignment textAlign, bool showEllipsis, bool useMnemonic)
{
textAlign = ctl.RtlTranslateContent(textAlign);
TextFormatFlags flags = TextFormatFlagsForAlignmentGDI(textAlign) | (TextFormatFlags.TextBoxControl | TextFormatFlags.WordBreak);
if (showEllipsis)
{
flags |= TextFormatFlags.EndEllipsis;
}
if (ctl.RightToLeft == RightToLeft.Yes)
{
flags |= TextFormatFlags.RightToLeft;
}
if (!useMnemonic)
{
return (flags | TextFormatFlags.NoPrefix);
}
if (!ctl.ShowKeyboardCues)
{
flags |= TextFormatFlags.HidePrefix;
}
return flags;
}
示例2: CreateTextFormatFlags
/// <devdoc>
/// Get TextFormatFlags flags for rendering text using GDI (TextRenderer).
/// </devdoc>
internal static TextFormatFlags CreateTextFormatFlags(Control ctl, ContentAlignment textAlign, bool showEllipsis, bool useMnemonic ) {
textAlign = ctl.RtlTranslateContent( textAlign );
TextFormatFlags flags = ControlPaint.TextFormatFlagsForAlignmentGDI( textAlign );
// The effect of the TextBoxControl flag is that in-word line breaking will occur if needed, this happens when AutoSize
// is false and a one-word line still doesn't fit the binding box (width). The other effect is that partially visible
// lines are clipped; this is how GDI+ works by default.
flags |= TextFormatFlags.WordBreak | TextFormatFlags.TextBoxControl;
if( showEllipsis ) {
flags |= TextFormatFlags.EndEllipsis;
}
// Adjust string format for Rtl controls
if( ctl.RightToLeft == RightToLeft.Yes ) {
flags |= TextFormatFlags.RightToLeft;
}
//if we don't use mnemonic, set formatFlag to NoPrefix as this will show the ampersand
if( !useMnemonic ) {
flags |= TextFormatFlags.NoPrefix;
}
//else if we don't show keyboard cues, set formatFlag to HidePrefix as this will hide
//the ampersand if we don't press down the alt key
else if( !ctl.ShowKeyboardCues ) {
flags |= TextFormatFlags.HidePrefix;
}
return flags;
}