C# 如何更改c中字体对话框的默认设置#

C# 如何更改c中字体对话框的默认设置#,c#,fonts,C#,Fonts,如何将默认字体对话框脚本从“西文”更改为“阿拉伯文”?将AllowScriptChange设置为false后,将字体对话框中的阿拉伯语替换为西文 如何防止在效果中显示删除线和下划线FontDg.ShowEffects=false但颜色显示为true?如何显示没有效果的颜色 谢谢。\u fontDialog.ShowDialog(); Var test=_fontDialog.Font.GdiCharSet.GetHashCode() //会让你开始的。跟踪它[步进]并在调试模式下观察观察列表中的

如何将默认字体对话框脚本从“西文”更改为“阿拉伯文”?将AllowScriptChange设置为false后,将字体对话框中的阿拉伯语替换为西文

  • 如何防止在效果中显示删除线和下划线
    FontDg.ShowEffects=false
    但颜色显示为true?如何显示没有效果的颜色

  • 谢谢。

    \u fontDialog.ShowDialog(); Var test=_fontDialog.Font.GdiCharSet.GetHashCode()

    //会让你开始的。跟踪它[步进]并在调试模式下观察观察列表中的测试值更改,以发现其余的测试值。

    \u fontDialog.ShowDialog();
    /* Okay, sorry I didn't have more time for this the other day.
     * But there is a very simple/eloquent solution for this that will
     * leave you wondering why you didn't think of it. AND...
     * Such is programming LoL.
    */
    
    // Say I have existing code something like:
    
    PrintFont = PrintMasterSettings.Default.PrintFont;
    
    /* 
    * Where PrintSettings.Default.PrintFont is persistent storage for PrintFont.
    * Fine & dandy. The PrintFont gets brought back in, size, style, everything
    * BUT The Script Selection. Am I close to the problem a lot of people have
    * here Much YET?  ROFL. And try as you might you can't SET; the GdiCharSet
    * value Because _fontDialog.Font.GdiCharSet has no SETTER. Right?  Been
    * there done much more than that. No t-shirt... but I did figure it out in
    * about ten minutes after sleeping on it.
    *
    * What to charge for the answer and who to sell it to?  LOL. Give up yet???
    * Well, I have an "advantage" in that I'm self-taught. Think out of that box
    * most programming profs have never done much programming. True fact.
    * So how to do it is alluding you because you are trying to do it the
    * "right way" and, instead, should be focused on doing it period.
    *
    * "Some way, GdiCharSet my ***; MAKE IT GD work!" the boss said. 
    * "Searching StackOverflow says it can't be done." I said. 
    * "Prove them wrong!" he said. "If you buy lunch?" I said with finality.
    * "Fine!" he said. ***I had a Nice thick and rare New York steak!
    *
    */
    
    // Okay, So now I simply call my special custom method like so:
    
    PrintFont = GetFontWithScript();
    
    // Okay, I mean don't feel dumb. Things don't always work in .NET...
    // NOT like you'd think they should. But there is usually a simple way.
    // I'm thinking it's an indexer to a collection right. But no it's just as
    // Gd simple. LoL  Enjoy! (yes, this really works. The initial value for
    // PrintSettings.Default.GdiCharSet should be set to 1 btw.)
    
    // Then somewhere before your _fontDialog.ShowDialog(); you have:
    
    _fontDialog.Font = PrintFont;
    
    // Right...  But the big money is in the method. Check in the mail? LoL
    // Promise you won't feel dumb? Because you're not, you made it to here!
    // You searched it and found someone who knew. That's pretty smart!
    // Nobody around here even knows what I'm on about mate. G'day.
    // JpE@ facebook-dot-com/JpESystems/
    
    // Okay here it is... This should help a lot of peeps. 
    // Please mark This ANSWER AS USEFUL if it helps you guys and gals out.
    //\\//\\//\\//\\//\\//\\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
    
    private Font GetFontWithScript()
    {
      PrintFont   = PrintMasterSettings.Default.PrintFont;
      var name    = PrintFont.Name;
      var size    = PrintFont.Size;
      var style   = PrintFont.Style;
      var unit    = PrintFont.Unit;
      var charSet = PrintMasterSettings.Default.GdiCharSet;// byte value btw.
    
      return new Font(name,size,style,unit,charSet);
      /*
      * Font(String, Single, FontStyle, GraphicsUnit, Byte) 
      * Initializes a new Font using a specified size, style, 
      * unit and character set.
      * 
      */
    }
    
    Var test=_fontDialog.Font.GdiCharSet.GetHashCode()


    //会让你开始的。跟踪它[step into],并在调试模式下的观察列表中观察测试值的变化,以发现其余部分。

    这些选项不可用,不在FontDialog中,也不在低级Windows API函数(ChooseFont)中。从技术上讲,您可以使用此答案中显示的方法绕过此限制:这些选项不可用,在FontDialog中不可用,在低级Windows API函数(ChooseFont)中也不可用。从技术上讲,您可以使用以下答案中所示的方法绕过该限制:
    /* Okay, sorry I didn't have more time for this the other day.
     * But there is a very simple/eloquent solution for this that will
     * leave you wondering why you didn't think of it. AND...
     * Such is programming LoL.
    */
    
    // Say I have existing code something like:
    
    PrintFont = PrintMasterSettings.Default.PrintFont;
    
    /* 
    * Where PrintSettings.Default.PrintFont is persistent storage for PrintFont.
    * Fine & dandy. The PrintFont gets brought back in, size, style, everything
    * BUT The Script Selection. Am I close to the problem a lot of people have
    * here Much YET?  ROFL. And try as you might you can't SET; the GdiCharSet
    * value Because _fontDialog.Font.GdiCharSet has no SETTER. Right?  Been
    * there done much more than that. No t-shirt... but I did figure it out in
    * about ten minutes after sleeping on it.
    *
    * What to charge for the answer and who to sell it to?  LOL. Give up yet???
    * Well, I have an "advantage" in that I'm self-taught. Think out of that box
    * most programming profs have never done much programming. True fact.
    * So how to do it is alluding you because you are trying to do it the
    * "right way" and, instead, should be focused on doing it period.
    *
    * "Some way, GdiCharSet my ***; MAKE IT GD work!" the boss said. 
    * "Searching StackOverflow says it can't be done." I said. 
    * "Prove them wrong!" he said. "If you buy lunch?" I said with finality.
    * "Fine!" he said. ***I had a Nice thick and rare New York steak!
    *
    */
    
    // Okay, So now I simply call my special custom method like so:
    
    PrintFont = GetFontWithScript();
    
    // Okay, I mean don't feel dumb. Things don't always work in .NET...
    // NOT like you'd think they should. But there is usually a simple way.
    // I'm thinking it's an indexer to a collection right. But no it's just as
    // Gd simple. LoL  Enjoy! (yes, this really works. The initial value for
    // PrintSettings.Default.GdiCharSet should be set to 1 btw.)
    
    // Then somewhere before your _fontDialog.ShowDialog(); you have:
    
    _fontDialog.Font = PrintFont;
    
    // Right...  But the big money is in the method. Check in the mail? LoL
    // Promise you won't feel dumb? Because you're not, you made it to here!
    // You searched it and found someone who knew. That's pretty smart!
    // Nobody around here even knows what I'm on about mate. G'day.
    // JpE@ facebook-dot-com/JpESystems/
    
    // Okay here it is... This should help a lot of peeps. 
    // Please mark This ANSWER AS USEFUL if it helps you guys and gals out.
    //\\//\\//\\//\\//\\//\\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
    
    private Font GetFontWithScript()
    {
      PrintFont   = PrintMasterSettings.Default.PrintFont;
      var name    = PrintFont.Name;
      var size    = PrintFont.Size;
      var style   = PrintFont.Style;
      var unit    = PrintFont.Unit;
      var charSet = PrintMasterSettings.Default.GdiCharSet;// byte value btw.
    
      return new Font(name,size,style,unit,charSet);
      /*
      * Font(String, Single, FontStyle, GraphicsUnit, Byte) 
      * Initializes a new Font using a specified size, style, 
      * unit and character set.
      * 
      */
    }