LostInSpace Posted June 2, 2003 Posted June 2, 2003 As you can tell...username is LostIn Space and classified as a newcomer...I'm in my 2nd week...what did you expect? I am trying to get a multiline propertied textbox to display the equation (entered by the user) and the answer to the equation. I then want to drop down a line in the text box and enter the next equation and answer. I have gotten to where I can display the result of the equation using Me.SumTbox.text = Val(TBox1.text) + Val(TBox2.text)...AND I can display the equation with Me.SumTextBox.Text() = TBox1.Text + " + " + TBox2.Text + " = "...BUT I can't append the later statement to the first (error)...and can't get the line drop for the next entry. Thanks Quote
Leaders dynamic_sysop Posted June 2, 2003 Leaders Posted June 2, 2003 you need SumTextBox.Text to be SumTextBox.SelectedText otherwise the original text will be replaced. and just add VbCrlf at the end. Quote
*Experts* Bucky Posted June 2, 2003 *Experts* Posted June 2, 2003 Set the Multiline property of the textbox to True to allow for multi-line characters to be displayed correctly. As for your concatenation, it looks like you have two different names for the same textbox: SumTBox and SumTextBox. Which is it? Also, use the & operator for concatenating strings together, and keep the + operator for adding numbers; it's a better practice. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
*Experts* mutant Posted June 2, 2003 *Experts* Posted June 2, 2003 To append use this method: TextBox1.AppendText() And for new line it is good to use System.Environment.NewLine(). Quote
LostInSpace Posted June 2, 2003 Author Posted June 2, 2003 Thanks Sysop, but what about displaying the answer along with the equation? In my amatuerish way, I thought I could just append the code that got the answer for me to the other part I posted which displayed the user supplied operands for the equation. NOT! Cheers in the UK Quote
LostInSpace Posted June 2, 2003 Author Posted June 2, 2003 You guys are too good. I had several more replies before I could get my reply to Sysop. I think I have found a home to grow into VB and start supplying answers myself in a day or two. HA! Bucky, it was a copy/paste mistake...The text boxes were named the same in code but I tried to shorten for the post and messed up. Quote
LostInSpace Posted June 2, 2003 Author Posted June 2, 2003 It is all working now thanks to you guys Thanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.