DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: trigger a txtboxes leave event through code

  1. #1
    bradyg Guest

    trigger a txtboxes leave event through code


    i would like to trigger a txtbox's leave event through code...this has to
    be possible

  2. #2
    Russell Jones Guest

    Re: trigger a txtboxes leave event through code

    Sure, just call the event subroutine. For example, suppose you have an event
    handler

    Protected Sub text1_leave(ByVal sender as System.Object, ByVal e as
    System.EventArgs) Handles Text1.Leave
    MessageBox.Show("Text1 Leave")
    End Sub

    Anywhere else in your code, if Text1 has the focus, you can fire the even by
    setting the focus to some other control. Or you can call the event directly
    at any time.
    text1_leave(text1, Nothing)

    Note that calling the event directly does *not* cause the the focus to
    change; if you want to force the textbox to lose focus, set the focus
    somewhere else.

    "bradyg" <bgier@bellsouth.net> wrote in message
    news:3cbed76d$1@10.1.10.29...
    >
    > i would like to trigger a txtbox's leave event through code...this has to
    > be possible




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center