GetNextControl - How to use???
Posted on 2003-03-06
When I Enter a particular control on a WinForm, I need to know the previous control. I have the following code:
private void txtFirstNames_Enter(object sender, System.EventArgs e)
Control currCtl = (Control)sender; //current control
Control prevCtl = currCtl.GetNextControl(currCtl, false) //previous control
The problem with the above code is that prevCtl = null after executing the line.
According to the Microsoft docs (which are totally inadequate - with NO code examples), the format of the GetNextControl method is:
Control ctl, //control to start searching from
boolean direction //false - go back; true - go forward
What am I doing wrong???? A code snippet will help as well as an explanation of why my code is not working. I'm sure it's something simple.
TIA - NM.
PS: sorry for the low points, but that's all I have left!