VB2010 Me.Focused = True-VBForums
Results 1 to 2 of 2

Thread: VB2010 Me.Focused = True

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2011

    VB2010 Me.Focused = True

    Is there anyway for a form to become in focus.. basically something like Me.inFocused = True
    In order to print a form, it must be visible and in focus, so I need to focus on it without the user having to click it so that I can send the form to a printer


  2. #2
    Fanatic Member proneal's Avatar
    Join Date
    May 2011

    Re: VB2010 Me.Focused = True

    Hi ablaty, the only place I could actually see results was in the Form1_Shown Sub.
    I tried most the routines, but Shown was the only one that worked in the way I wanted.
    vb Code:
    1. Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
    2.         If Me.CanFocus Then
    3.             Me.Focus()
    4.             Debug.Print("I got the focus in From1_Shown Sub")
    6.         End If
    7.     End Sub

Tags for this Thread

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