I have multiple control in the form. 10+ textboxes, 2 listviews, 3 grids etc.
Each one of them will do different things on GetFocus. The textboxes will change back color, the listview will highlight the related items and the grids will highlight active rows.
I don't want to use control arrays and I don't want to write in multiple GotFocus/LostFocus. The only idea I have is, checking wheather Me.ActiveControl has changed or not from a timer.
vb Code:
Private Sub tmrFocus_Timer() Static PrevActiveCtl As Control If Not (Me.ActiveControl Is PrevActiveCtl) Then Set PrevActiveCtl = Me.ActiveControl 'Active Control Changed. Do your thing. Else 'ActiveControl not changed. Do nothing End If End Sub
Can any one suggest me any better idea ?
.




Reply With Quote