|
-
Sep 2nd, 2000, 08:20 AM
#1
Thread Starter
Member
I'm really a beginner so I need an answer for this stupid question:
How to make a text box and do that everything you'll write in it will immediately appear on the form.
-
Sep 2nd, 2000, 08:25 AM
#2
Ex-Super Mod'rater
Say the name of the text box is " txtMyBox " then all u do is:
Private sub txtMyBox_Change()
[ whatever you want to say it in] = txtMyBox.text
End Sub
-
Sep 2nd, 2000, 08:38 AM
#3
Thread Starter
Member
maybe i'm wrong but...
i ment that the text box itself would be empty but when you run the app, when you'll write something it will also apear on the form.
-
Sep 2nd, 2000, 08:43 AM
#4
Ex-Super Mod'rater
I don't get it, is this what u mean :
1. you want it to copy the text you put in the textbox on to another object ?
2. You want it to put text into the text box when the form is loaded or on another event?
3. Other.
Last edited by Electroman; Jun 6th, 2004 at 04:56 AM.
-
Sep 2nd, 2000, 08:46 AM
#5
Fanatic Member
If you want that what you put in a text box will be on the
form you should use this code:
Private Sub Text1_Change()
Me.Cls
Print Text1.Text
End Sub
Try it.
-
Sep 2nd, 2000, 09:05 AM
#6
Thread Starter
Member
No,
What i mean is, to do a simple program that only has a text box control, when you write something in the text box it will also apear on the form.
let's say i want to do the same thing only the text will apear as the form's caption, i will do something like this:
text1.text = form1.caption
i want to do the same thing only the text will apear on the form...
-
Sep 2nd, 2000, 09:11 AM
#7
Guru
You mean, appear on the form's title. 
Exactly the opposite of the other code:
Code:
Form1.Caption = Text1.Text
-
Sep 2nd, 2000, 09:19 AM
#8
Thread Starter
Member
Thanks everyone but the example of Dekelc already work.
no can someone explain it please, what do this mean:
Private Sub Text1_Change()
Me.Cls
Print Text1.Text
End Sub
-
Sep 2nd, 2000, 09:35 AM
#9
Guru
Here, it's commented. 
Code:
Private Sub Text1_Change() ' Code below will execute when you type something in the TextBox
Cls ' Remove whatever it says on the form
Print Text1.Text ' Print on the form whatever it says on the TextBox
End Sub
-
Sep 2nd, 2000, 09:41 AM
#10
Thread Starter
Member
Thanks For everyone that Helped,
but i have another small question (i'm sorry):
If I take out the "cls", it jumps to a new line every
time I write another letter.
why?
-
Sep 2nd, 2000, 09:49 AM
#11
Addicted Member
It will do - the Print command goes to a new line and writes whatever.
You are new at VB aren't you.....?!
-
Sep 2nd, 2000, 10:05 AM
#12
Thread Starter
Member
I already said i'm new to VB (my first week),
but you didn't answer my question:
cls just supose to clear the form,isn't it,
so why if I delete it, every time i write a letter
it jumps to a new line and write it.
-
Sep 2nd, 2000, 10:09 AM
#13
Monday Morning Lunatic
Cls clears the form and also resets the drawing origin (where it starts from) to the top left. Every time you call Print, it moves this origin down to below the last printed text.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 2nd, 2000, 10:12 AM
#14
_______
<?>
Private Sub Text1_Change()
Me.Cls
Print Text1.Text
End Sub
doesn't jump for me...
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 2nd, 2000, 10:14 AM
#15
Thread Starter
Member
-
Sep 2nd, 2000, 01:38 PM
#16
Originally posted by macron
Thanks For everyone that Helped,
but i have another small question (i'm sorry):
If I take out the "cls", it jumps to a new line every
time I write another letter.
why?
If you do not like where it prints, you can set it by changing the CurrentX and CurrentY properties.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|