I just want to be able to print text where ever the cursor is located in my application.
It doesn't matter whether it's in textbox1 textbox2 or textbox3, i just want it to print in whichever one has focus.
How do i go about doing this?
Printable View
I just want to be able to print text where ever the cursor is located in my application.
It doesn't matter whether it's in textbox1 textbox2 or textbox3, i just want it to print in whichever one has focus.
How do i go about doing this?
Forget it, solved the problem myself :D
For future reference if anyone needs to know, it's "sendkeys.send()"
I tried doing this and ended up with this:
VB Code:
Dim cmdTemp As Control For Each cmdTemp In Me.Controls If TypeOf cmdTemp Is TextBox And cmdTemp Is Me.ActiveControl Then CType(cmdTemp, TextBox).SelectedText = "abc" Exit For End If Next
Problem is, I placed it in a command button's click event, so the command button ends up getting focus. Woe is me.