locked
Restrict no of lines and character per lines in Richtextbox control RRS feed

  • Question

  • Hi,

    How to restrict  no of lines and character per lines in Richtextbox control in text changed Event?

    Thank you

    • Moved by OmegaMan Wednesday, June 24, 2009 6:23 PM (From:Visual C# Language)
    Wednesday, June 24, 2009 9:21 AM

All replies

  • Please post any winform/control related questions to the Windows Forms General forum. The C# forum is for C# related questions on the language constructs and not indirect component usage. thx I will move it this time....
    William Wegerson (www.OmegaCoder.Com)
    Wednesday, June 24, 2009 6:23 PM
  • How to restrict  no of lines and character per lines in Richtextbox control in text changed Event?

    Hi Kaleeswara Murthy,

    Could you please explain it for me. I cannot understand your meaning.

    Sincerely,
    Kira Qian

    Please mark the replies as answers if they help and unmark if they don't.
    Thursday, June 25, 2009 7:38 AM
  • Hi Kira,

    Thanks for your reply.

    I need to allow only 50 character per line and 5 lines.

    User typing the letter automatically after 50th character have to come next line .

    Also Allow only 5 lines.
    Empty line also need to count.
    Thursday, June 25, 2009 8:58 AM
  • Hi Kaleeswara Murthy,

    That's not easy to do. Since the Lines property of RichTextBox will return the number your user actually press enter key to start new line. If your user input the word and RichTextBox automatically turn to a new line, the Lines property won't increase.

    Sincerely,
    Kira Qian
    Please mark the replies as answers if they help and unmark if they don't.
    Tuesday, June 30, 2009 6:25 AM