|
-
Dec 3rd, 2005, 06:29 AM
#1
Thread Starter
Fanatic Member
using textbox
Hi,
I have only two text-boxes on the form.I will use text1.text for inputting datas
and pressing ENTER key to send the datas and display the entries in "text2.text"
I don't know which event to assing to the textbox..
thanks
VB Code:
Private Sub Text1_LostFocus()
Dim f As Integer
f = FreeFile
Open App.Path & "\sabit.html" For Append As f
Write #f, "........................."
Write #f, "isim:..", Text1.Text
Write #f, "telefon..", Text1.Text
Close #f
Dim buffer As String, hFile As Long
hFile = FreeFile()
Open App.Path & "\sabit.html" For Binary Access Read Lock Write As #hFile
buffer = Space(LOF(hFile))
Get #hFile, , buffer
Close #hFile
Text2.Text = buffer
Text1.Text = ""
End Sub
-
Dec 3rd, 2005, 06:36 AM
#2
Re: using textbox
you can use Key_Down event
VB Code:
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text2.Text = Text1.Text
End If
End Sub
Or you're trying to say that this doesn't work?
-
Dec 3rd, 2005, 06:42 AM
#3
Thread Starter
Fanatic Member
Re: using textbox
Ok, it is good but it allows me to write only one letter...before I press "enter"
There must be another solution for this...
-
Dec 3rd, 2005, 06:49 AM
#4
Re: using textbox
thats your choice, you could..
1) Add a button, so the user press it to finish
2) Use Change() event, so Text2.text = Text1.text each time a key is pressed
3) Like MSN Messenger, SHIFT + ENTER = New line, and ENTER ALONE = Send the message
... just some posibilities.
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
|