That was the reason I said idea for control array is not good: cmdButton can hold reference only to one object. Statement:
Set cmdButton = UserControl.Controls.Add("VB.CommandButton", sButtonName, fraControl)
causes cmdButton to refer new button and previous buttons will not raise the event... Till now I not discover way to make "Dim ... WithEvents" statement work with control array...
If you know how much buttons will be added, add for each button WithEvents-variable. If not... I will search for solution, but I'm not sure how much time this will take...
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?...