textbox text color change

后端 未结 3 1776
鱼传尺愫
鱼传尺愫 2021-01-05 12:58

I have textbox textbox1 and I want to change text color, but in the part of all text. For example from /* to */ like comm

3条回答
  •  甜味超标
    2021-01-05 13:41

    You can do this, however, you may want to look into the RichTextBox control where is it much easier to do.

    Simple example:

    richtextbox.SelectionFont = new Font("Verdana", 10, FontStyle.Regular);
    richtextbox.SelectionColor = Color.Blue;
    

提交回复
热议问题