Oops, I'm sorry. Change declaration:
'Wrong!!!
Dim WithEvents ctlNewControl as VBControlExtender
to:
!OK
Dim WithEvents ctlNewControl as CommandButton
You will have the same events like with normal commant button.
Code with VBControlExtender you can use with non-intrinsict controls (i.e. ActiveX controls).
I'm not sure you can organize dynamically added controls in control arrays. I think best way is to handle every command button separate.
Plamen Ivanov
MCSD .NET Early Achiever and MCAD .NET Charter Member (VB .NET/SQL Server 2000)
MCSD (VB 6.0/SQL Server 2000) br>
VB (.NET) - what other language do you need in the whole Universe?...