Results 1 to 4 of 4

Thread: [RESOLVED] key press

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    13

    Resolved [RESOLVED] key press

    hi guys.
    i am experimenting with active x in vb6 at the moment. do you have any idea how a textbox in the a control can detect when enter is pressed, and when pressed the textbox has some text appear.

    cheers

  2. #2
    Fanatic Member
    Join Date
    Aug 2005
    Location
    Up State NY
    Posts
    525

    Re: key press

    Could try an API call to read the key press.
    If the "RTN" button is pressed fill the text box else exit sub.

    Check allapi.net for the call.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    13

    Re: key press

    Thank for your reply. This is the code i am experimenting with.

    activex has 1 textbox called txtSearchValue

    VB Code:
    1. Public Event newSearch()
    2.  
    3. Public Property Get recID() As String
    4.    redID = txtSearchValue.Text
    5. End Property
    6.  
    7. Public Property Let recID(ByVal vNewValue As String)
    8.  
    9. End Property
    10.  
    11. Private Sub txtSearchValue__KeyDown(KeyCode As Integer, Shift As Integer)
    12. If KeyCode = 13 Then
    13.    RaiseEvent newSearch
    14. End If
    15. End Sub



    vb form has a label called lbltest
    Code:
    Private Sub bms1_newSearch()
       lblTest.Caption = bms1.recID
    End Sub

    if possible could you help me find why this is not updating lbltest on the vb form with the value inputting into the activex control.

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: key press

    Quote Originally Posted by timoteius

    VB Code:
    1. Public Event newSearch()
    2.  
    3. Public Property Get recID() As String
    4.    redID = txtSearchValue.Text
    5. End Property
    When you read recID you're not getting any value, because the text in txtSearchValue is being loaded into redID. Or was that typo generated when you typed the code into the forum instead of copying it and pasting it?

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