FiRe
New Member
Posts: 1,800
|
Post by FiRe on Oct 10, 2003 13:12:00 GMT -5
Hey, I have a textbox which is on multi and allows return. When I use a command like this br] TextBox1.Text = "blah" It deletes everything inside textbox1 and replaces it with blah. How can I get it to just add blah instead of clearing the textbox??
|
|
|
Post by Lazer on Oct 10, 2003 14:49:26 GMT -5
u meen like
TextBox1.Text = Textbox1.Text & "bahh"
|
|
Ryan
New Member
Posts: 18
|
Post by Ryan on Oct 10, 2003 19:05:01 GMT -5
I think you mean,
Textname.Text = Textname.text + vbNewLine + "blah"
|
|
Ryan
New Member
Posts: 18
|
Post by Ryan on Oct 10, 2003 19:05:35 GMT -5
or lazers if you want it all together, but for a new line that one.
|
|
Tewl
xTeam
C# & VB Developer
Posts: 495
|
Post by Tewl on Oct 10, 2003 20:20:07 GMT -5
In VB .Net
' Adds text to end of existing text
textbox.AppendText(vbCrLf & "Add Text")
|
|
FiRe
New Member
Posts: 1,800
|
Post by FiRe on Oct 11, 2003 4:14:17 GMT -5
TextBox1.AppendText(vbCrLf & "blah") Still deletes everything and replaces it with blah
|
|
Ryan
New Member
Posts: 18
|
Post by Ryan on Oct 11, 2003 4:23:13 GMT -5
Did you even try mine ? Also make sure that the text box is multi line..
|
|
FiRe
New Member
Posts: 1,800
|
Post by FiRe on Oct 11, 2003 5:28:06 GMT -5
Sorry ryan i didnt see yours, thanks Also whats the command to get an input box and then insert it as the text. For example TextBox1.Text = TextBox1.Text + vbNewLine + " $$?="Enter what you wanna say" Obviously the bold bit is mIRC code but I just wanna show u what I mean?!
|
|
Ryan
New Member
Posts: 18
|
Post by Ryan on Oct 11, 2003 6:33:11 GMT -5
Use a variable for it...
Dim blahblah as String blahblah = InputBox ("Blah") TextBox1.Text = TextBox1.Text + vbNewLine + blahblah
|
|
Ryan
New Member
Posts: 18
|
Post by Ryan on Oct 11, 2003 6:35:54 GMT -5
I only started to learn vb two days ago my self lol
|
|
Maverick
New Member
www.mavetech.tk
Posts: 174
|
Post by Maverick on Oct 11, 2003 6:43:50 GMT -5
yes but the code is wrong cuz it wont add the text the user have inserted but it will add blah instead here is a fix of the code Dim blahblah as String blahblah = InputBox ("Blah") TextBox1.Text = TextBox1.Text + vbNewLine + blahblah
|
|
Ryan
New Member
Posts: 18
|
Post by Ryan on Oct 11, 2003 7:56:08 GMT -5
lol oh ya should be blahblah not blah typo
|
|
FiRe
New Member
Posts: 1,800
|
Post by FiRe on Oct 11, 2003 12:03:33 GMT -5
Well that works great except I now want to add things to it. So instead of it saying whatever is said in the input box, I want a bit before and after. I am making an HTML builder and thus used this br] Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim blahblah As String blahblah = InputBox("Enter A Title") TextBox1.Text = TextBox1.Text + vbNewLine + blahblah End Sub I changed br]TextBox1.Text = TextBox1.Text + vbNewLine + blahblah to br]TextBox1.Text = TextBox1.Text + vbNewLine + <title> blahblah </title>but it gave me errors (obviously <title> isn't a command it knows)!! I put it in " br] TextBox1.Text = TextBox1.Text + vbNewLine + "<title> blahblah </title> "But it doesn't read whatever is now in the input, it simplies says: <title> blahblah </title> ??
|
|
Ryan
New Member
Posts: 18
|
Post by Ryan on Oct 11, 2003 12:17:15 GMT -5
Ok, you have to use a " " whenever its not a variable or textbox etc... and i think the <> and / will mess it up so try this...
Dim blah As String blah = InputBox("blah?") Text1.Text = Text1.Text + vbNewLine + Chr(60) + "title" + Chr(62) & blah + Chr(60) + Chr(47) + "title" + Chr(62)
Dim blah As String blah = InputBox("blah?") Text1.Text = Text1.Text + vbNewLine + "<title>" + blah + "</title>"
both work actually...
|
|
FiRe
New Member
Posts: 1,800
|
Post by FiRe on Oct 11, 2003 13:57:30 GMT -5
Dim blahblah As String blahblah = InputBox("Enter A Background Color (e.g. Red or a source code)") TextBox1.Text = TextBox1.Text + vbNewLine + "<bg color= "" + blahblah + " > ""
Can u see for bgcolor I want it to insert a " so there are too many of them. How can I turn 1 of them into a chr??
|
|