سؤال

I have a RichTextBox control used to display message items. The richtextbox shows the old message and allows the user to add new text as a reply.

I am trying to find a way to add a grey line before each of the replies so the user knows it was a previous thread (like outlook).

I have tried using the graphics element but I cannot seem to get any lines created in my control at all. The only way I can achieve a line is to use the rtbMessage.AppendText("___________") The problem with this is I don't know how to detect the end of the line so I can stop. Otherwise, it wraps onto the next line and looks messy.

هل كانت مفيدة؟

المحلول

The RichTextBox control is not a graphical control like a canvas.

When I have to do something like what you are describing, I change the background color of the text in question.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top