954,582 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to send a keystroke to an inactive VB6 form

Dear all,
I need to send a string value along with an 'Enter' keystroke from an active form to a multi-line text box in an inactive form. Tell me a way to do this in VB6.

Thanks.

sureshprg
Newbie Poster
3 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

If I understand your question correctly, the following -

Private Sub txtString_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then
    Form2.txtString.Text = txtString.Text
End If
End Sub
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

Your question is not that clear...
if you're saying a string value with a newline you can do this:

Form2.txtDestination.Text = "My string value" & vbCrLf

-> if it doesn't work with

vbCrLf


, then try

vbNewline
PoisonedHeart
Junior Poster in Training
57 posts since Jul 2009
Reputation Points: 14
Solved Threads: 14
 

Thanks PoisonedHeart. I used vbNewLine. It worked.

sureshprg
Newbie Poster
3 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

It's a pleasure of helping!...Goodluck!!

PoisonedHeart
Junior Poster in Training
57 posts since Jul 2009
Reputation Points: 14
Solved Threads: 14
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You