Click here to Skip to main content
15,909,656 members
Home / Discussions / C#
   

C#

 
GeneralRe: datatable Pin
Blue_Boy2-Dec-09 7:57
Blue_Boy2-Dec-09 7:57 
GeneralRe: datatable Pin
farokhian2-Dec-09 8:16
farokhian2-Dec-09 8:16 
GeneralRe: datatable Pin
Saksida Bojan2-Dec-09 8:24
Saksida Bojan2-Dec-09 8:24 
GeneralRe: datatable Pin
farokhian2-Dec-09 8:46
farokhian2-Dec-09 8:46 
GeneralRe: datatable Pin
Saksida Bojan2-Dec-09 8:55
Saksida Bojan2-Dec-09 8:55 
GeneralRe: datatable Pin
farokhian2-Dec-09 9:18
farokhian2-Dec-09 9:18 
GeneralRe: datatable Pin
Blue_Boy2-Dec-09 9:34
Blue_Boy2-Dec-09 9:34 
GeneralRe: datatable Pin
Saksida Bojan2-Dec-09 10:25
Saksida Bojan2-Dec-09 10:25 
If you are using Controls, it doesn't matter if Controls are public, private or protected

http://i26.photobucket.com/albums/c104/bsaksida/Pic-1.png[^]

That is a link to a pic. That 3 textboxex at the button are in a custom control. I did not change anysthing at custom control expect added 3 text boxex

The code belov was inside OnLoad event
int nCountText = 0;
            foreach (Control ctr in Controls)
            {
                if (ctr is GroupBox)
                {
                    GroupBox gb = ctr as GroupBox;
                    foreach (Control ctrlGB in gb.Controls)
                    {
                        if (ctrlGB is TextBox)
                        {
                            TextBox tb = ctrlGB as TextBox;
                            nCountText++;
                            tb.Text = "This text box is within Group Box with a name: \"" + ctrlGB.Name + "\" and has Text: \"" + gb.Text + "\". Its Textbox number is: " + nCountText.ToString();
                        }
                    }
                }
                else if (ctr is TextBox)
                {
                    TextBox tb = ctr as TextBox;
                    nCountText++;
                    tb.Text = "This TextBox is not Within Group box. Text Box name is: \"" + tb.Name + "\" And it is " + nCountText.ToString() + ". control found";
                }
                else if (ctr is UserControl1)
                {
                    UserControl1 uc = ctr as UserControl1;

                    foreach (Control ctrUc in uc.Controls)
                    {
                        if (ctrUc is TextBox)
                        {
                            ctrUc.Text = "I Made it";
                        }
                    }
                }
            }


PS: If this is too hard, then i suggest go to regular 80 lines to change all TextBox text property
GeneralRe: datatable Pin
Saksida Bojan2-Dec-09 8:10
Saksida Bojan2-Dec-09 8:10 
GeneralRe: datatable Pin
DaveyM692-Dec-09 11:24
professionalDaveyM692-Dec-09 11:24 
QuestionHow to access fields and values from an XML Database Pin
DTWC_Lawrence2-Dec-09 6:35
DTWC_Lawrence2-Dec-09 6:35 
AnswerRe: How to access fields and values from an XML Database Pin
puri keemti3-Dec-09 23:05
puri keemti3-Dec-09 23:05 
QuestionSystem.Diagnostics.Process.Start Pin
CoderOnline2-Dec-09 6:27
CoderOnline2-Dec-09 6:27 
AnswerRe: System.Diagnostics.Process.Start Pin
Saksida Bojan2-Dec-09 6:32
Saksida Bojan2-Dec-09 6:32 
GeneralRe: System.Diagnostics.Process.Start....modified Pin
CoderOnline2-Dec-09 6:34
CoderOnline2-Dec-09 6:34 
GeneralRe: System.Diagnostics.Process.Start....modified Pin
Saksida Bojan2-Dec-09 6:37
Saksida Bojan2-Dec-09 6:37 
GeneralRe: System.Diagnostics.Process.Start....modified Pin
Saksida Bojan2-Dec-09 6:50
Saksida Bojan2-Dec-09 6:50 
GeneralRe: System.Diagnostics.Process.Start....modified Pin
CoderOnline2-Dec-09 7:08
CoderOnline2-Dec-09 7:08 
Questionwia temp picture problem Pin
mehrdad3332-Dec-09 6:18
mehrdad3332-Dec-09 6:18 
QuestionGZipStream problem Pin
zeeShan anSari2-Dec-09 6:03
zeeShan anSari2-Dec-09 6:03 
AnswerRe: GZipStream problem Pin
harold aptroot2-Dec-09 6:08
harold aptroot2-Dec-09 6:08 
GeneralRe: GZipStream problem Pin
zeeShan anSari2-Dec-09 6:19
zeeShan anSari2-Dec-09 6:19 
GeneralRe: GZipStream problem Pin
Shameel2-Dec-09 6:58
professionalShameel2-Dec-09 6:58 
GeneralRe: GZipStream problem Pin
harold aptroot2-Dec-09 7:02
harold aptroot2-Dec-09 7:02 
GeneralRe: GZipStream problem Pin
Saksida Bojan2-Dec-09 7:11
Saksida Bojan2-Dec-09 7:11 

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.