我怎样才能检测到的FlowDirection从右至左或LeftToRight自动在WPF [英] How can I detect the Flowdirection RightToLeft or LeftToRight automatically in WPF

查看:539
本文介绍了我怎样才能检测到的FlowDirection从右至左或LeftToRight自动在WPF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来检测文本框的的FlowDirection自动根据统一code字符用?

Is there a way to detect the FlowDirection in TextBox automatically based on the Unicode Characters used?

如果您有阿拉伯文字在Excel中它会自动对准右侧的单元格。我想在我的WPF应用程序相同的逻辑。有没有人有经验,这一点,并能告诉我如何做到这一点?

If you have an Arabic text in Excel it is automatically aligned to the right side of the cell. I would like the same logic in my WPF application. Has anyone experience with this and can tell me how to do this?

推荐答案

基地,在您的解决方案... http://windows-tech.info/13/5fa183aedccd93df.php

Base your solution in... http://windows-tech.info/13/5fa183aedccd93df.php

相关code是

public bool IsArabic(string strCompare)
{
  char[] chars = strCompare.ToCharArray();
  foreach (char ch in chars)
    if (ch >= '\u0627' && ch <= '\u0649') return true;
  return false;
}

另外,请检查的UNI code标准的阿拉伯语部分... HTTP://www.uni$c$c.org/charts/

Also check the Arabic section of the Unicode standard... http://www.unicode.org/charts/

这篇关于我怎样才能检测到的FlowDirection从右至左或LeftToRight自动在WPF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆