Chaning colors of certin lines in a textbox
-
Is it possible to change the color of only certin lines in a text box? I am trying to write a cheap game for my senior project and I thought it would be cool to be able to change color of the text if I was getting hit by something to red, and have me hitting the enemy in white. If anyone has any helpful thoughts please email them to me or post them. Thanks so much Tommy
-
Is it possible to change the color of only certin lines in a text box? I am trying to write a cheap game for my senior project and I thought it would be cool to be able to change color of the text if I was getting hit by something to red, and have me hitting the enemy in white. If anyone has any helpful thoughts please email them to me or post them. Thanks so much Tommy
You know 'txtSample.ForeColor = vbColorRed' can change your text's color, but all lines. It's impossible to change colors of only certain lines in textbox. I have 2 ways to solve this problem (I often do): **1)**I think textbox is not for displaying, it's for inputing. So you should use 2 labels: 1 for you and 1 for the enemy. When you are getting hit X| , your label red, enemy's label white:mad:, contrary... **2)**You can use a RichTextBox: rtbSample.SelText.ForeColor = vbColorRed but it's not my favourite because the RichTextBox control is very complex:sigh:. I post this reply on a computer without Visual Basic installed, so that I can't test the code. If you don't like my answer:( or don't understand:confused:, reply me, I will find another way (I pay attention to this problem too!) GF bos