|
-
Jan 10th, 2006, 03:25 PM
#1
Thread Starter
New Member
[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
-
Jan 11th, 2006, 02:42 PM
#2
Fanatic Member
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.
-
Jan 11th, 2006, 08:30 PM
#3
Thread Starter
New Member
Re: key press
Thank for your reply. This is the code i am experimenting with.
activex has 1 textbox called txtSearchValue
VB Code:
Public Event newSearch()
Public Property Get recID() As String
redID = txtSearchValue.Text
End Property
Public Property Let recID(ByVal vNewValue As String)
End Property
Private Sub txtSearchValue__KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
RaiseEvent newSearch
End If
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.
-
Feb 3rd, 2006, 09:48 PM
#4
Re: key press
 Originally Posted by timoteius
VB Code:
Public Event newSearch()
Public Property Get recID() As String
redID = txtSearchValue.Text
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|