Results 1 to 3 of 3

Thread: Printing text where the cursor is

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    5

    Printing text where the cursor is

    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?

  2. #2

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    5
    Forget it, solved the problem myself

    For future reference if anyone needs to know, it's "sendkeys.send()"

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    I tried doing this and ended up with this:

    VB Code:
    1. Dim cmdTemp As Control
    2.  
    3.  
    4.  
    5.  
    6.         For Each cmdTemp In Me.Controls
    7.             If TypeOf cmdTemp Is TextBox And cmdTemp Is Me.ActiveControl Then
    8.                 CType(cmdTemp, TextBox).SelectedText = "abc"
    9.                 Exit For
    10.             End If
    11.  
    12.         Next

    Problem is, I placed it in a command button's click event, so the command button ends up getting focus. Woe is me.

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