質問

Maby they question was kinda hard. so im going to explain it the best i can.

When i have this Code in my Textbox1 "[Color=#000000] [/color]" i want to Select 5 characters after # so i get 000000

what im trying to do is simply.

Covert the [color=#000000][/color] into html

heey Found something :).

my code =

        TextBox2.Text = TextBox1.Text

    TextBox2.Text = TextBox2.Text.Replace("color=", "<font color=" + DubbelQ)
    TextBox2.Text = TextBox2.Text.Replace("#", myNum + ">")
    TextBox2.Text = TextBox2.Text.Replace("[/color]", "</font>")

it Converts [color=#ColorCode][/color] into ColorCode

役に立ちましたか?

解決

I'm not sure what you are trying to exactly achieve but.... I don't think you have to select insert or replace....

  1. User inputs a hex value in TextBox1
  2. User Clicks button.
  3. Code on button click will take hex value and ???? at the moment all I can assume it is going to output the text in Texbox2 as a html tag

    Sub button1_click(sender as Object, e as EventArgs) Handles button1.click
    
        Dim outputString as String = "<font color='#" & TextBox1.Text & "'>Test Text</font>"
    
        TextBox2.Text = outputString
    
    End Sub
    
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top