Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4538068
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:45:40+00:00 2026-05-21T14:45:40+00:00

Requirement I am using Vistual Studio 2005. I need Textbox which Should support Japanese

  • 0

Requirement

I am using Vistual Studio 2005. I need Textbox which

  • Should support Japanese language. User should be able to paste Japanese text in textbox.
  • Text in textbox should always be Bold.
  • Text after 100 characters should be highlighted in Yellow color when user is typing.
  • Textbox should not allow any other formatted text.

Solution I tried

  1. Normal Textbox with FontStyle set to Bold.
    Issue : I can paste Japanese text and text always remains BOLD. Only issue is textbox does not support highlighting of text as user types.

  2. RichTextBox : Highlight text in TextChanged eventhandler.

    handler = new System.EventHandler(richTextBox1_TextChanged);
    
    private void richTextBox1_TextChanged(object sender, EventArgs e)
    {
        this.richTextBox1.TextChanged -= this.handler;
        int index = richTextBox1.SelectionStart;
    
        richTextBox1.Select(0, richTextBox1.Text.Length);
        richTextBox1.SelectionBackColor = Color.White;
        richTextBox1.SelectionLength = 0;
    
        if (richTextBox1.Text.Length > 100)
        {
            richTextBox1.Select(100, richTextBox1.Text.Length);
            richTextBox1.SelectionBackColor = Color.Yellow;
            richTextBox1.SelectionLength = 0;
        }
    
        richTextBox1.SelectionStart = index;
        this.richTextBox1.TextChanged += this.handler;
    }
    

    Highthing works fine. But there are following issues.

    • When I copy paste Japanese text into richtextbox, it is shown as Squre boxes. But if I assign same japanese text programmatically, it is displayed correctly. Even in normal textbox the pasted text is shown correctly. So not sure what is the problem with richtextbox.

    • I could not disable formatting of richtextbox. e.g. If I copy some html text with hyperlinks and paste in richtextbox, I see the hyperlinks. And my requriment says NO formatting except BOLD is allowed.

I want to acheive this functionality using windows form controls. Third party control would be my last option.

Can someone help?

Thanks in Advance!

~Sambha

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T14:45:41+00:00Added an answer on May 21, 2026 at 2:45 pm

    I got one solution, but not sure if this is the efficient way of doing it and if it will cause some other issues.

    Solution : Create subclass from RichTextBox and ovverride KeyDown event. Check if Ctrol+V or Shift+Inst key was pressed, call paste method using DataFormats.UnicodeText.

    class MyRichTextBox : RichTextBox
    {
    
    protected override void OnKeyDown(KeyEventArgs e)
    {
        switch (e.KeyData)
        {
            case (Keys.Shift | Keys.Insert): 
            case (Keys.Control | Keys.V):
    
                this.Paste(DataFormats.GetFormat(DataFormats.UnicodeText));
                e.SuppressKeyPress = true;
    
                return;
        }
    
        base.OnKeyDown(e);
    }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are developing customized installer using visual studio 2008 installer project. The requirement which
I am using SQL Server 2005. I have a requirement to list out all
Consider a Visual Studio 2010 project whose requirement is to model the data using
im using visual studio 2008. my requirement is to implement single sign on across
We are using visual studio 2008-My requirement is to allocate some memory, store data
I am using visual studio set up project to create my msi Installer.My requirement
I am using Visual Studio 2005 (VS.8.0) and I am looking to enforce the
I'm using RichFaces per a client requirement, but the markup it (and the stock
We have a requirement to generate PDF documents using information from a PDA /
I'm using PowerShell v1.0 (It is a requirement that I cannot use 2.0) and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.