How to get previous control in C #

how to get previous control in c #

there is a way to GetNextControl but there is no way to get the previous control whether any body can tell me how I can get this

thanx in advance

+4
source share
3 answers

GetNextControl(Control control, bool forward) you can specify whether you want to get control forward or backward. For example, to get back control over button1 , you can do:

 Control previous = GetNextControl(button1, false);//false indicates backward 
+9
source

GetNextControl () will return the previous control if you pass false to your second argument:

 Control prev = yourControl.GetNextControl(origin, false); 

I agree that the method name is somewhat confusing, but you are probably really looking for the next control in only the other direction.

+3
source

Yes, you can use it like:

 var control = GetNextControl(origControl, false); 
+2
source

All Articles