当前位置: 首页>>代码示例>>C#>>正文


C# Control.RtlTranslateContent方法代码示例

本文整理汇总了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;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:ControlPaint.cs

示例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;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:34,代码来源:ControlPaint.cs


注:本文中的System.Windows.Forms.Control.RtlTranslateContent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。