Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    [VB2008] Trovare oggetto che perde il focus

    Ciao

    ho una text box e una masktextbox e vorrei capire come trovare il controllo

    che ha perso il focus.

    Private Sub txt_DB_0_LostFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtbox.LostFocus, maschedtxtbox.LostFocus

    If TypeOf Is TextBox Then
    End If

    If TypeOf Is MaskedTextBox Then
    End If

    End Sub

    Grazie

  2. #2
    Nel parametro sender c'è un riferimento all'oggetto che ha causato l'evento, per cui...
    codice:
    Private Sub txt_DB_0_LostFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtbox.LostFocus, maschedtxtbox.LostFocus
        If TypeOf sender Is TextBox Then
            '...
        Else If TypeOf sender Is MaskedTextBox Then
            '...
        End If
    End Sub
    Amaro C++, il gusto pieno dell'undefined behavior.

  3. #3
    ok! grazie

  4. #4
    Di niente; ciao!
    Amaro C++, il gusto pieno dell'undefined behavior.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.