Option Explicitdim Withevents Object As VbconTroleXtender 'uses WitHevents declares VBControlExtender variables
Private Sub LoadControl () 'Licenses.Add "Project1.Control1", "ewrinvcmcoe" Licenses.Add "MSFlexGridLib.MSFlexGrid", _ "72E67120-5959-11cf-91F6-C2863C385E30" Set objExt = Controls.Add ( "MSFlexGridLib.MSFlexGrid "," myctl ") with object .left = 0 .top = 0 .width = me.scalewidth .height = me.scaleHeight .Visible = true 'This control is invisible in the default. .Tooltiptext = "This is a MSFLEXGRID control!" End welhend Sub
Private Sub Form_Load () loadControlEnd Sub
Private subject_ObjectEvent (Info As EventInfo) Write the event handler for the control using the SELECT CASE statement. Select Case Info.name Case "Click" is delegated here. MsgBox "Click Event" addresses other cases Case Else 'unknown event' to process various unknown events. 'Msgbox "Else Event" End SelectenD Sub