Click here to Skip to main content
15,911,646 members
Home / Discussions / C#
   

C#

 
QuestionResizable control? Pin
Wmzong13-May-03 16:41
Wmzong13-May-03 16:41 
GeneralDataGrid... Row Selection & Column Header Alignment Pin
jmt9n13-May-03 13:28
jmt9n13-May-03 13:28 
Generaliconic child window Pin
Anonymous13-May-03 12:44
Anonymous13-May-03 12:44 
GeneralWindows Form Dialog when Logged Out Pin
Ingram Leedy13-May-03 10:53
Ingram Leedy13-May-03 10:53 
GeneralRe: Windows Form Dialog when Logged Out Pin
IrvTheSwirv14-May-03 2:01
sussIrvTheSwirv14-May-03 2:01 
GeneralRe: Windows Form Dialog when Logged Out Pin
Ingram Leedy14-May-03 10:56
Ingram Leedy14-May-03 10:56 
GeneralWindows Forms Pin
pahlsson13-May-03 10:11
pahlsson13-May-03 10:11 
GeneralRe: Windows Forms Pin
David Stone13-May-03 10:38
sitebuilderDavid Stone13-May-03 10:38 
This will work for just the controls on the form:

foreach(Control subControl in myForm.Controls)
{
    subControl.Text = "Howdy!";
}


However, if your controls have sub-controls (like a TabControl has it's own Control collection full of TabPages which then have their own controls), you'd have to use recursion.

SetSubControlText(Control ctrl, string text)
{
    if(ctrl.Controls.Count > 0)
    {
        foreach(Control subControl in ctrl.Controls)
        {
           subControl.Text = text;
           SetSubControlText(subControl);
        }
    }
}


If you call it like this: SetSubControlText(this, "Howdy!"); then you'll be passing the form to it and the method will loop through every control on the form, and their sub-controls, and set their text to Howdy!.

That should work...but I'm at school right now, and on their crappy computers without VS.NET, so this is untested. If it doesn't work, let me know and I'll look at it tonight. Smile | :)


Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...

-Anna-Jayne Metcalfe on Paintballing

GeneralRe: Windows Forms Pin
pahlsson13-May-03 22:39
pahlsson13-May-03 22:39 
QuestionHow to get screen area Pin
J. Dunlap13-May-03 9:24
J. Dunlap13-May-03 9:24 
AnswerRe: How to get screen area Pin
leppie13-May-03 11:49
leppie13-May-03 11:49 
GeneralRe: How to get screen area Pin
J. Dunlap13-May-03 18:17
J. Dunlap13-May-03 18:17 
QuestionFind the namespace an object is from? Pin
FruitBatInShades13-May-03 8:43
FruitBatInShades13-May-03 8:43 
AnswerRe: Find the namespace an object is from? Pin
leppie13-May-03 9:05
leppie13-May-03 9:05 
GeneralRe: Find the namespace an object is from? Pin
FruitBatInShades13-May-03 9:28
FruitBatInShades13-May-03 9:28 
GeneralControls created in one thread cannot parent in other thread - delegate. Pin
Mrso13-May-03 5:37
Mrso13-May-03 5:37 
GeneralRe: Controls created in one thread cannot parent in other thread - delegate. Pin
leppie13-May-03 9:07
leppie13-May-03 9:07 
GeneralRe: Controls created in one thread cannot parent in other thread - delegate. Pin
Mrso14-May-03 4:19
Mrso14-May-03 4:19 
GeneralRe: Controls created in one thread cannot parent in other thread - delegate. Pin
Richard Deeming14-May-03 5:35
mveRichard Deeming14-May-03 5:35 
Generaladding form to a panel Pin
zuhx13-May-03 5:30
zuhx13-May-03 5:30 
General[Announce] diagnosing interop marshaling Pin
Stephane Rodriguez.13-May-03 5:15
Stephane Rodriguez.13-May-03 5:15 
GeneralRe: [Announce] diagnosing interop marshaling Pin
David Stone13-May-03 5:23
sitebuilderDavid Stone13-May-03 5:23 
GeneralRe: [Announce] diagnosing interop marshaling Pin
Kant13-May-03 6:15
Kant13-May-03 6:15 
GeneralRe: [Announce] diagnosing interop marshaling Pin
David Stone13-May-03 7:54
sitebuilderDavid Stone13-May-03 7:54 
GeneralRe: [Announce] diagnosing interop marshaling Pin
Kant13-May-03 8:11
Kant13-May-03 8: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.