|
Hi, I have this code:
Public Overridable Sub ModeChange(ByVal ctrlContainer As Control, ByVal Sender As Control) Dim ctrl As Control
For Each ctrl In ctrlContainer.Controls If ctrl.HasChildren Then ModeChange(ctrl, Sender) If Not TypeOf ctrl Is Label Then If blBlue Then ctrl.BackColor = System.Drawing.Color.FromArgb(CType(214, System.Byte), CType(223, System.Byte), CType(245, System.Byte)) ctrl.Tag += "*" Else ctrl.BackColor = System.Drawing.SystemColors.Control ctrl.ForeColor = System.Drawing.Color.FromArgb(CType(0, System.Byte), CType(0, System.Byte), CType(0, System.Byte)) If InStr(ctrl.Tag, "*") Then ctrl.Tag = Mid(ctrl.Tag, 1, Len(ctrl.Tag) - 1) End If End If End If Next ctrl End Sub
So basically it appends a * to the tag and changes the color depending on the boolean's (blBlue) value. I would like to select the first text box (or control) in the groupbox. If after next ctrl I add: ctrl.select It does what I want it do, after it selects each of the controls... which I do not want it to do. Any ideas or suggestions? -Edward
|