hey guys i need some help, i want what ever the user types in text box1 to be in text box2 EXCEPT i want it to have tags around it. so say a user types "hello" in the first text box i was the second text box to read "!hello!" or something similar.
Printable View
hey guys i need some help, i want what ever the user types in text box1 to be in text box2 EXCEPT i want it to have tags around it. so say a user types "hello" in the first text box i was the second text box to read "!hello!" or something similar.
What have you tried that isn't working?
well im not sure what would work, i know textbox1.text=textbox2.text but im not sure how i would get it to add the extra trags like !hello!
try this
vb Code:
textbox2.text = "!" textbox1.text "!"
if you want to use more tags you can use a radio button and use a if statement or select statement..
i tried it but it says end of statement expected, and im not sure where the end of the statement would go xD
sorry my mistake you need to put & before textbox1.text and in the last..
vb Code:
textbox2.text = "!" & textbox1.text & "!"
thank you very much :D
no problem mate :D
lol now that works i run into another issues. well flow i should say. when you type something in the textbox it does appear with !example! but when you type sumthing below that and uncheck the box, the whole thing gets untagged for example
i type hello in textbox1 and check the checkbox, textbox2 reads !hello!
but if it type sumthing under that so textbox1 reads
textbox2 doesnt readQuote:
hello
there
it readsCode:!hello!
there
is there any way i can have it "Save" or store the previously converted text?Code:!hello
there!
You're not going to learn if I do it for you. You don't become good at programming by copying and pasting.
But, now that I think about it, that's probably not the best of doing it anyway. Instead, you might want to use String.Split + a combination of a loop and .Lines.
Try this, this, and this, play around with some code and post back the code that isn't working. Actually put some effort into it and we'll view the code that isn't working, then offer suggestions.
Actually, you don't even have to do all that. I just did a quick test and was able to do it:
http://img39.imageshack.us/img39/1002/unledul.png
It was as simple as first declaring a class variable as a List(Of String). You can declare the variable anywhere though.
Then in the CheckBox's CheckChanged event, I looped through each .Line in the TextBox and called .Add on my List(Of String).
Then I looped through each string in the List and added it to the TextBox via:
VB.NET Code:
Me.txtTest2.Text &= Me.txtChar.Text & s & Me.txtChar.Text & Environment.NewLine
If you look through my post carefully, I've given you everything you need to know.