Private WithEvents myKennel As clsKennel. Once you declare an object variable using the WithEvents keyword, select the object from the Object drop-down list, and the event becomes available from the Procedure drop-down list, as shown in Figure 12-10. VBA creates the procedure stub based on the arguments you supplied when you defined the event.
Dim WithEvents btn as Button. public sub New() btn = new Button() btn.Location = new Point(50,50) btn.Text = "Test". private sub btn_Click(ByVal sender as object
Private WithEvents m_Inspectors As Outlook.Inspectors Private WithEvents m_Inspector As Outlook.Inspector Private Sub Application_Startup() Set m_Inspectors = Application.Inspectors End Sub Private Sub m_Inspectors_NewInspector(ByVal Inspector As Outlook.Inspector) If TypeOf Inspector.CurrentItem Is Outlook.MailItem Then 'Handle emails only Set m_Inspector = Inspector End If End Sub Private ...
Private WithEvents myKennel As clsKennel. Once you declare an object variable using the WithEvents keyword, select the object from the Object drop-down list, and the event becomes available from the Procedure drop-down list, as shown in Figure 12-10. VBA creates the procedure stub based on the arguments you supplied when you defined the event.