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
Printable View
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
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.
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.
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?Quote:
Originally Posted by timoteius