Click here to Skip to main content
16,007,932 members
Home / Discussions / C#
   

C#

 
GeneralRe: @-quoted strings Pin
Member 118129410-Jun-05 4:07
Member 118129410-Jun-05 4:07 
GeneralRe: @-quoted strings Pin
Pyro Joe10-Jun-05 9:50
Pyro Joe10-Jun-05 9:50 
GeneralIndexed textboxes Pin
patgo10-Jun-05 2:27
patgo10-Jun-05 2:27 
GeneralRe: Indexed textboxes Pin
S. Senthil Kumar10-Jun-05 2:47
S. Senthil Kumar10-Jun-05 2:47 
GeneralThank you very much!!! Pin
patgo10-Jun-05 3:36
patgo10-Jun-05 3:36 
GeneralRe: Indexed textboxes Pin
Colin Angus Mackay10-Jun-05 2:58
Colin Angus Mackay10-Jun-05 2:58 
GeneralThank you very much!!! Pin
patgo10-Jun-05 3:36
patgo10-Jun-05 3:36 
GeneralRe: Indexed textboxes Pin
Member 118129410-Jun-05 4:17
Member 118129410-Jun-05 4:17 
An alternative approach could be to generate the array dynamically, the framework is already storing references to all of the controls, both static and dynamic, so you can just recurse through the ControlCollections pulling out all of the ones of the required type.

        <br />
        private void searchControlTree(ControlCollection colControls , ArrayList allCtls,  System.Type ctlType)<br />
        {<br />
            foreach (Control c in colControls )<br />
            {<br />
                if ( c.GetType() == ctlType)<br />
                    allCtls.Add(c) ;<br />
<br />
                if (c.Controls.Count > 0 )<br />
                    searchControlTree(c.Controls, allCtls, ctlType ) ;<br />
            }<br />
        }<br />
<br />
        public ArrayList findControlByType( System.Type ctlType)<br />
        {<br />
            ArrayList allCtls = new ArrayList();<br />
            searchControlTree(this.Controls, allCtls, ctlType) ;<br />
<br />
            return allCtls ;<br />
        }<br />
<br />
        ArrayList a = findControlByType( typeof(TextBox)) ;


If you need a real array at the end the ArrayList has a ToArray() method. If you combine this approach to finding the controls together with the control Name or Tag properties you can filter out whatever controls you want.


Hope this is usefull Jackson
GeneralRe: Indexed textboxes Pin
nemopeti10-Jun-05 12:24
nemopeti10-Jun-05 12:24 
GeneralCustom Editor for TreeView Nodes!!!&amp;#9786; Pin
sharaabi10-Jun-05 2:08
sharaabi10-Jun-05 2:08 
QuestionHow to close a form in its Load event handler Pin
Waleed Eissa10-Jun-05 1:14
Waleed Eissa10-Jun-05 1:14 
AnswerRe: How to close a form in its Load event handler Pin
nemopeti10-Jun-05 1:51
nemopeti10-Jun-05 1:51 
AnswerRe: How to close a form in its Load event handler Pin
MoustafaS10-Jun-05 1:53
MoustafaS10-Jun-05 1:53 
AnswerRe: How to close a form in its Load event handler Pin
MoustafaS10-Jun-05 1:56
MoustafaS10-Jun-05 1:56 
AnswerRe: How to close a form in its Load event handler Pin
DavidNohejl10-Jun-05 2:11
DavidNohejl10-Jun-05 2:11 
AnswerRe: How to close a form in its Load event handler Pin
Dave Kreskowiak10-Jun-05 4:01
mveDave Kreskowiak10-Jun-05 4:01 
AnswerRe: How to close a form in its Load event handler Pin
Waleed Eissa10-Jun-05 5:43
Waleed Eissa10-Jun-05 5:43 
AnswerRe: How to close a form in its Load event handler Pin
Waleed Eissa10-Jun-05 5:52
Waleed Eissa10-Jun-05 5:52 
GeneralRe: How to close a form in its Load event handler Pin
methodincharge10-Jun-05 9:10
methodincharge10-Jun-05 9:10 
GeneralRe: How to close a form in its Load event handler Pin
Robert Rohde10-Jun-05 9:12
Robert Rohde10-Jun-05 9:12 
GeneralInformation about png files Pin
Anonymous10-Jun-05 0:57
Anonymous10-Jun-05 0:57 
GeneralRe: Information about png files Pin
DavidNohejl10-Jun-05 1:27
DavidNohejl10-Jun-05 1:27 
GeneralWord.dll Pin
Gktony9-Jun-05 23:59
Gktony9-Jun-05 23:59 
GeneralRe: Word.dll Pin
Vasudevan Deepak Kumar10-Jun-05 0:09
Vasudevan Deepak Kumar10-Jun-05 0:09 
GeneralRe: Word.dll Pin
Gktony13-Jun-05 1:24
Gktony13-Jun-05 1: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.