Click here to Skip to main content
15,897,187 members
Home / Discussions / C#
   

C#

 
GeneralRe: VSS Pin
NetPointerIN12-Sep-03 8:25
NetPointerIN12-Sep-03 8:25 
GeneralRe: VSS Pin
leppie12-Sep-03 9:00
leppie12-Sep-03 9:00 
Questionwhat textboxes are on my form? Pin
.gonad12-Sep-03 7:45
.gonad12-Sep-03 7:45 
AnswerRe: what textboxes are on my form? Pin
Mazdak12-Sep-03 7:55
Mazdak12-Sep-03 7:55 
AnswerRe: what textboxes are on my form? Pin
mcgahanfl12-Sep-03 9:48
mcgahanfl12-Sep-03 9:48 
AnswerRe: what textboxes are on my form? [edited] Pin
leppie12-Sep-03 10:31
leppie12-Sep-03 10:31 
AnswerRe: what textboxes are on my form? Pin
David Stone12-Sep-03 10:31
sitebuilderDavid Stone12-Sep-03 10:31 
AnswerRe: what textboxes are on my form? Pin
mcgahanfl12-Sep-03 14:41
mcgahanfl12-Sep-03 14:41 
All of the solutions given to you will work, if you just want textbox controls on the "FORM".

But if your form contains tab-controls or frame-controls and you would like to know what/if these containers also contain textbox controls, then I think you need the solution I gave you.

Lastly, if you do not care about textbox controls nested inside tab pages that are not active you could use GetNextControl().

Here is an example.
public void SetFocusOnFirstEmptyControl()
{
int iCount=0;
System.Windows.Forms.Control Traverse = this;
//System.Reflection
while(Traverse != null)
{
Debug.WriteLine(++iCount + " " + Traverse.Text );
//myChild.GetType().BaseType.Equals(typeof(myFatherClass))

if(Traverse.GetType() == typeof(CheckBox) ||
Traverse.GetType().IsSubclassOf(typeof(CheckBox)))
{//do special case handling for check box
System.Windows.Forms.CheckBox pCheck = (System.Windows.Forms.CheckBox)Traverse;
if(pCheck.Checked== false)
{
Traverse.Focus();
break;
}
}
if(Traverse.Text.Length == 0)
{//test controls like textbox and dropdown
Traverse.Focus();
break;
}
Traverse = GetNextControl(Traverse, true);

}//while


}//SetFocusOnFirstEmptyControl

You have a lot of good people helping you. An answer is assured.

GeneralRe: what textboxes are on my form? Pin
.gonad14-Sep-03 10:35
.gonad14-Sep-03 10:35 
GeneralListBox control and Datasource Pin
KevinS7512-Sep-03 5:11
KevinS7512-Sep-03 5:11 
GeneralSmart User Control Pin
cvandyke12-Sep-03 5:10
cvandyke12-Sep-03 5:10 
GeneralWeird problem with C# proxy server Pin
viperxp12-Sep-03 3:11
viperxp12-Sep-03 3:11 
GeneralCheckedListBox disable items Pin
Robert L. Edwards12-Sep-03 2:25
Robert L. Edwards12-Sep-03 2:25 
GeneralRe: CheckedListBox disable items Pin
mattknapp14-Sep-03 16:36
mattknapp14-Sep-03 16:36 
GeneralCardinal Spline Pin
Meysam Mahfouzi12-Sep-03 1:22
Meysam Mahfouzi12-Sep-03 1:22 
GeneralRe: Cardinal Spline Pin
Philip Fitzsimons12-Sep-03 2:23
Philip Fitzsimons12-Sep-03 2:23 
GeneralRe: Cardinal Spline Pin
Meysam Mahfouzi12-Sep-03 9:15
Meysam Mahfouzi12-Sep-03 9:15 
GeneralPixelwise transparency Pin
m.teusner11-Sep-03 23:37
m.teusner11-Sep-03 23:37 
GeneralRead form exe.config file Pin
nahumtakum11-Sep-03 22:52
nahumtakum11-Sep-03 22:52 
GeneralRe: Read form exe.config file Pin
Nick Parker12-Sep-03 1:36
protectorNick Parker12-Sep-03 1:36 
GeneralRe: Read form exe.config file Pin
nahumtakum12-Sep-03 6:45
nahumtakum12-Sep-03 6:45 
GeneralRe: Read form exe.config file Pin
Nick Parker12-Sep-03 6:58
protectorNick Parker12-Sep-03 6:58 
Generalexceptions, remoting and marshalling Pin
RedSunBeer11-Sep-03 22:39
RedSunBeer11-Sep-03 22:39 
GeneralOPF.Net (Object Persistent Framework for .Net) Pin
nothign12312311-Sep-03 22:09
nothign12312311-Sep-03 22:09 
GeneralRe: OPF.Net (Object Persistent Framework for .Net) Pin
Ernesto Perales Soto12-Sep-03 13:24
Ernesto Perales Soto12-Sep-03 13:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.