Click here to Skip to main content
15,900,258 members
Home / Discussions / C#
   

C#

 
GeneralRe: I would like to refine an array. Pin
Ernesto Perales Soto12-Sep-03 13:18
Ernesto Perales Soto12-Sep-03 13:18 
GeneralRe: I would like to refine an array. Pin
Nnamdi Onyeyiri13-Sep-03 1:24
Nnamdi Onyeyiri13-Sep-03 1:24 
GeneralVSS Pin
yyf12-Sep-03 8:07
yyf12-Sep-03 8:07 
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 
Let me give you a few clues. I am new at this so bear with me.

1. Read through all controls on the form, like this

..
private ArrayList m_VisibleList = new ArrayList(); //poor name, it is all controls not just visible ones
...

public void BuildListOfAllControlsOnForm()
{//build a list of all controls on the form
m_VisibleList.Clear();
m_VisibleList.Add(this);
ArrayList aPendingControlListTemp = new ArrayList();//used to avoid
aPendingControlListTemp.Add(this);
System.Windows.Forms.Control CtrlParent = null;
System.Windows.Forms.Control CtrlChild = null;
for(int i=0; i < aPendingControlListTemp.Count; i++)
{//progress thru for loop for the form and any tab pages or frame
CtrlParent = (System.Windows.Forms.Control)aPendingControlListTemp[i];
for(int iIter = 0; iIter < CtrlParent.Controls.Count; iIter++)
{
CtrlChild = CtrlParent.Controls[iIter];
Debug.WriteLine("Parent hash " + CtrlParent.GetHashCode() + " Child hash " + CtrlChild.GetHashCode());
m_VisibleList.Add(CtrlChild);
if(CtrlChild.Controls.Count > 0)
{//tab page or frame control
aPendingControlListTemp.Add(CtrlChild);
}
}

}
aPendingControlListTemp.Clear();

int iCount = 0;
foreach(System.Windows.Forms.Control Ctrl in m_VisibleList)
{
Debug.WriteLine(++iCount + " " + Ctrl.Text );
}
}//BuildListOfAllControlsOnForm


2nd. Loop through your list and ask which are Textboxes, that code would be something like this
...
System.Windows.Forms.Control Traverse; where Traverse would point to an element in VisibleList.
...

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;
}
}

Let me know if this is too much and I will try to refine it for you.
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 
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 

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.