Text Help!
Text Help!
Text Help!
Text Help!
Text Help!
Text Help! Text Help! Text Help! Text Help! Text Help! Text Help! Text Help! Text Help!
Text Help! Text Help!
Text Help!
Go Back  Xtreme Visual Basic Talk > > > Text Help!


Reply
 
Thread Tools Display Modes
  #1  
Old 11-22-2006, 04:38 PM
baorder54's Avatar
baorder54 baorder54 is offline
Newcomer
 
Join Date: Nov 2006
Location: SaN DiEgO
Posts: 21
Question Text Help!


Hey guys, Im making a TI-83+ basic editor. It has a textbox, where the basic program goes. I also have comboboxes where you can select the commands. The combobox is aka the Catalog. Anyway, when i select an item from the combo box, i insert that string using a button. But if i insert another command, it overwrites my first text. How can i make it insert the command next to the first one.

You probably realize i am noob bigtime on vb so i also have another question. If i have 2 textboxes, and i want the first to go to the second one in a different language, like asm, how acn i make it so it puts each command on next line?

For example:

This is wat i want:
Not This:
: Disp Hello
: Disp Hello Prompt A,B
: Prompt A,B


Thanks to whoever helps me!
Reply With Quote
  #2  
Old 11-22-2006, 04:49 PM
Eduardo Lorenzo's Avatar
Eduardo Lorenzo Eduardo Lorenzo is offline
Senior Contributor
 
Join Date: Jun 2006
Location: Manila, Philippines
Posts: 846
Default

please do paste your code so we can work on it.

You probable have something like

textbox1.text = combobox1.text

this will overwrite the previous contents.
try

textbox1.text = textbox1.text + combobox1.text

or use vbCrLf if you want to insert the new text/command as another line.
Reply With Quote
  #3  
Old 11-22-2006, 04:49 PM
jutsu's Avatar
jutsu jutsu is offline
Junior Contributor
 
Join Date: Jul 2006
Posts: 343
Default

Hi, For your first question, can i see your code please?

For the second one, you mean you want to type a text in textbox 1, press a button and it will be written into textbox 2 in the next line??
If so, set the textbox2 multiline property to true to append the line you can use this code:
Code:
Private Sub cmd1_Click() txt2.Text = txt2.Text & vbNewLine & txt1.Text End Sub
Reply With Quote
  #4  
Old 11-22-2006, 04:52 PM
baorder54's Avatar
baorder54 baorder54 is offline
Newcomer
 
Join Date: Nov 2006
Location: SaN DiEgO
Posts: 21
Default

Eduardo Lorenzo , Thank u thats exactly what i wanted, how would i get each command to go onto a new line?
Reply With Quote
  #5  
Old 11-22-2006, 04:56 PM
DiurnalText Help! Diurnal is offline
Enthusiast

Retired Leader
* Expert *
 
Join Date: Apr 2002
Location: Bellevue, WA.
Posts: 3,233
Default

See post #3.
__________________
Marty

Try searching for an answer first.
Tag your code [vb][/vb] and be patient... everyone here is a volunteer.
Reply With Quote
  #6  
Old 11-22-2006, 04:59 PM
baorder54's Avatar
baorder54 baorder54 is offline
Newcomer
 
Join Date: Nov 2006
Location: SaN DiEgO
Posts: 21
Default

where is post #3? u mean the 2nd one under mine since mine is the first?
Reply With Quote
  #7  
Old 11-22-2006, 05:11 PM
jutsu's Avatar
jutsu jutsu is offline
Junior Contributor
 
Join Date: Jul 2006
Posts: 343
Default

The third one..
Reply With Quote
  #8  
Old 11-22-2006, 05:13 PM
DiurnalText Help! Diurnal is offline
Enthusiast

Retired Leader
* Expert *
 
Join Date: Apr 2002
Location: Bellevue, WA.
Posts: 3,233
Default

clicky

To add each command from the combobox to the textbox you can use the .Text property of each control:
Code:
Text1.Text = Text1.Text & vbNewLine & Combo1.Text
__________________
Marty

Try searching for an answer first.
Tag your code [vb][/vb] and be patient... everyone here is a volunteer.
Reply With Quote
  #9  
Old 11-22-2006, 05:20 PM
Eduardo Lorenzo's Avatar
Eduardo Lorenzo Eduardo Lorenzo is offline
Senior Contributor
 
Join Date: Jun 2006
Location: Manila, Philippines
Posts: 846
Default

I think I heard someone slap himself in the forehead after reading post #6
Reply With Quote
  #10  
Old 11-22-2006, 08:13 PM
baorder54's Avatar
baorder54 baorder54 is offline
Newcomer
 
Join Date: Nov 2006
Location: SaN DiEgO
Posts: 21
Default

Also guys how do i make it so that my first text box will have a colon as the first item in there to begin with, and then after that, everytime the user presses enter, (return) it makes a colon at the next line?
Reply With Quote
  #11  
Old 11-22-2006, 08:22 PM
Roger_Wgnr's Avatar
Roger_Wgnr Roger_Wgnr is offline
CodeASaurus Hex

Forum Leader
* Expert *
 
Join Date: Jul 2006
Location: San Antonio TX
Posts: 2,427
Default

Try
Code:
Text1.Text = Text1.Text & vbNewLine & ":" & Combo1.Text

By the way the post # is the number on the right of each post it starts with #.
__________________
Code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. ~Martin Golding
The user is a peripheral that types when you issue a read request. ~Peter Williams
MSDN Visual Basic .NET General FAQ
Reply With Quote
  #12  
Old 11-22-2006, 08:34 PM
baorder54's Avatar
baorder54 baorder54 is offline
Newcomer
 
Join Date: Nov 2006
Location: SaN DiEgO
Posts: 21
Default

Quote:
Originally Posted by Roger_Wgnr
Try
Code:
Text1.Text = Text1.Text & vbNewLine & ":" & Combo1.Text

By the way the post # is the number on the right of each post it starts with #.
I put that exact code into textbox1 where i want the colons to be before every line. I got errors wehn i ran it saying that...

text1 was not defined
text1 was not defined
combo1 was not defined

I then tried doing this:


TextBox1.Text = TextBox1.Text & vbNewLine & ":" & ComboBox1.Text

and my program stopped responding wehn i ran it.

Got anymore ideas?
Reply With Quote
  #13  
Old 11-22-2006, 08:42 PM
jutsu's Avatar
jutsu jutsu is offline
Junior Contributor
 
Join Date: Jul 2006
Posts: 343
Default

Does Text1 is exist?? Does Combo1 is exist?? Are you using VB 6??
Reply With Quote
  #14  
Old 11-22-2006, 09:17 PM
DiurnalText Help! Diurnal is offline
Enthusiast

Retired Leader
* Expert *
 
Join Date: Apr 2002
Location: Bellevue, WA.
Posts: 3,233
Default

Text1 or TextBox1 should be the name of your textbox control (as is true with Combo1 or ComboBox1).
__________________
Marty

Try searching for an answer first.
Tag your code [vb][/vb] and be patient... everyone here is a volunteer.
Reply With Quote
  #15  
Old 11-22-2006, 09:22 PM
baorder54's Avatar
baorder54 baorder54 is offline
Newcomer
 
Join Date: Nov 2006
Location: SaN DiEgO
Posts: 21
Default

I am using microsot visual basic 2005 express edition. I dont know if it is VB 6 but all i know is that it sawys text1 is wrong and textbox1 is right. The name of the textbox is alos just textbox1 so i dont see how VB is supposed to recognize it if its name is textbox1 but i call it text1
Reply With Quote
  #16  
Old 11-22-2006, 09:23 PM
MikeJ's Avatar
MikeJText Help! MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,747
Default

It is not VB6. 2005 is .NET.
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
  #17  
Old 11-22-2006, 09:25 PM
baorder54's Avatar
baorder54 baorder54 is offline
Newcomer
 
Join Date: Nov 2006
Location: SaN DiEgO
Posts: 21
Default

Ok then is this website only for vb 6? should i go somewhere else? can u guys still help me? i mean are the languages that different?
Reply With Quote
  #18  
Old 11-22-2006, 09:30 PM
MikeJ's Avatar
MikeJText Help! MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,747
Default

Nope, it's just everything suggested for you in this thread was VB6. Now, we'll help you with VB.NET code!
Code:
'See what this does? TextBox1.Text = "somestring" & Environment.NewLine & "someotherstring"
Environment.Newline is the correct way to show a line feed character, vbNewLine is the legacy way.
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
  #19  
Old 11-22-2006, 09:41 PM
baorder54's Avatar
baorder54 baorder54 is offline
Newcomer
 
Join Date: Nov 2006
Location: SaN DiEgO
Posts: 21
Default

Ok thanks that worked. Now Remeber everyone i have .NET but how do i make a colon on the first line in textbox1 from the beginning that the program starts?

(sorry for the complete noobness.)
Reply With Quote
  #20  
Old 11-22-2006, 10:00 PM
MikeJ's Avatar
MikeJText Help! MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,747
Default

TextBox1.Text = ":" & TextBox1.Text
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Text Help!
Text Help!
Text Help! Text Help!
Text Help!
Text Help!
Text Help! Text Help! Text Help! Text Help! Text Help! Text Help! Text Help!
Text Help!
Text Help!
 
Text Help!
Text Help!
 
-->