Results 1 to 4 of 4

Thread: using textbox

  1. #1

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    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:
    1. Private Sub Text1_LostFocus()
    2. Dim f As Integer
    3. f = FreeFile
    4. Open App.Path & "\sabit.html" For Append As f
    5. Write #f, "........................."
    6. Write #f, "isim:..", Text1.Text
    7. Write #f, "telefon..", Text1.Text
    8.  
    9. Close #f
    10. Dim buffer As String, hFile As Long
    11.     hFile = FreeFile()
    12.     Open App.Path & "\sabit.html" For Binary Access Read Lock Write As #hFile
    13.     buffer = Space(LOF(hFile))
    14.     Get #hFile, , buffer
    15.     Close #hFile
    16.      Text2.Text = buffer
    17.      Text1.Text = ""
    18. End Sub

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: using textbox

    you can use Key_Down event
    VB Code:
    1. Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    2.     If KeyCode = 13 Then
    3.         Text2.Text = Text1.Text
    4.     End If
    5. End Sub

    Or you're trying to say that this doesn't work?
    VB Code:
    1. Text2.Text = buffer

  3. #3

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    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...

  4. #4
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    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
  •  



Click Here to Expand Forum to Full Width