none
Why richtextbox languageOption default value is AutoFont and DualFont in my project? RRS feed

  • Question

  • I'm developing a winform application, when I use richtextbox I found that default value is  AutoFont and DualFont, but according to official documents about RichTextBoxLanguageOptions Enum, the default value should be AutoFontSizeAdjust( 16), 

    Code.

    private void InitializeComponent()
            {
                this.richTextBox1 = new System.Windows.Forms.RichTextBox();
                this.SuspendLayout();
                // 
                // richTextBox1
                // 
                this.richTextBox1.Location = new System.Drawing.Point(206, 122);
                this.richTextBox1.Name = "richTextBox1";
                this.richTextBox1.Size = new System.Drawing.Size(100, 96);
                this.richTextBox1.TabIndex = 0;
                this.richTextBox1.Text = "";
                this.richTextBox1.TextChanged += new System.EventHandler(this.richTextBox1_TextChanged);
                // 
                // Form1
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(800, 450);
                this.Controls.Add(this.richTextBox1);
                this.Name = "Form1";
                this.Text = "Form1";
                this.Load += new System.EventHandler(this.Form1_Load);
                this.ResumeLayout(false);

            }

    namespace WindowsFormsApp1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }

            private void Form1_Load(object sender, EventArgs e)
            {
                Console.WriteLine("LanguageOptions Value : " + this.richTextBox1.LanguageOption.ToString());
            }

            private void richTextBox1_TextChanged(object sender, EventArgs e)
            {
                Console.WriteLine("LanguageOptions Value : " + this.richTextBox1.LanguageOption.ToString());
            }
        }
    }

    Hope someone can help me solve this problem.Thanks.

    Wednesday, May 29, 2019 3:45 AM

All replies

  • this case is the same as mine.

    when i try to set default font to richtextbox rtf.the font will be changed by ime



    • Edited by nebulae666 Wednesday, May 29, 2019 4:03 AM
    Wednesday, May 29, 2019 3:54 AM
  • Hi Drifting Leaf,

    Thank you for posting here..

    I test the property. I get the same result with you. I will report this situation. I f I get something new, I will post feedback.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Drifting Leaf Tuesday, June 4, 2019 7:51 AM
    • Unmarked as answer by Drifting Leaf Tuesday, June 4, 2019 7:51 AM
    Friday, May 31, 2019 6:36 AM
    Moderator