Click here to Skip to main content
15,888,260 members
Home / Discussions / C#
   

C#

 
AnswerRe: Drawing a big image to real coordinates Pin
oobimoo1-Sep-08 0:18
oobimoo1-Sep-08 0:18 
GeneralRe: Drawing a big image to real coordinates Pin
ianhunt011-Sep-08 1:03
ianhunt011-Sep-08 1:03 
GeneralRe: Drawing a big image to real coordinates Pin
oobimoo1-Sep-08 8:19
oobimoo1-Sep-08 8:19 
GeneralRe: Drawing a big image to real coordinates Pin
ianhunt012-Sep-08 5:49
ianhunt012-Sep-08 5:49 
QuestionFather class how to use the special sub-category type [modified] Pin
huangrongchuan31-Aug-08 21:43
huangrongchuan31-Aug-08 21:43 
GeneralRe: Father class in how to use the special sub-category of type Pin
Guffa1-Sep-08 1:42
Guffa1-Sep-08 1:42 
GeneralRe: Father class in how to use the special sub-category of type Pin
huangrongchuan1-Sep-08 2:29
huangrongchuan1-Sep-08 2:29 
AnswerRe: Father class how to use the special sub-category type Pin
Guffa1-Sep-08 6:38
Guffa1-Sep-08 6:38 
It would be better if you posted the actual code that you try to use. It's hard to tell which errors in the code comes from mistakes typing it in and which errors it is that cause the actual problem.

You can do like this to get access to controls of a specific type:
private void findcontrol(Control.ControlCollection controls) {
   foreach (Control ctrl in controls) {
      WhateverControlYouWant whatEver = ctrl as WhateverControlYouWant;
      if (whatEver != null) {
         // here you can use the whatEver variable
      }
      findcontrol(ctrl.Controls);
   }
}

Here's a generic version of the method, taking a type and a delegate for whatever to do with the control:
private void ProcessControls<T>(Control.ControlCollection controls, Action<T> action) {
   foreach (Control ctrl in controls) {
      T t = ctrl as T;
      if (t != null) {
         action(t);
      }
      ProcessControls<T>(ctrl.Controls, action);
   }
}

Usage example:
ProcessControls<Button>(this, delegate(Button b){ b.Enabled = false; });


Despite everything, the person most likely to be fooling you next is yourself.

modified on Monday, September 1, 2008 12:45 PM

GeneralRe: Father class how to use the special sub-category type [modified] Pin
huangrongchuan1-Sep-08 15:45
huangrongchuan1-Sep-08 15:45 
QuestionHow to transfer all mails from one account to another. Pin
ekpravasi31-Aug-08 20:18
ekpravasi31-Aug-08 20:18 
AnswerRe: How to transfer all mails from one account to another. Pin
Harvey Saayman31-Aug-08 20:41
Harvey Saayman31-Aug-08 20:41 
AnswerRe: How to transfer all mails from one account to another. Pin
ekpravasi31-Aug-08 21:13
ekpravasi31-Aug-08 21:13 
QuestionDevice ID Pin
ellllllllie31-Aug-08 20:16
ellllllllie31-Aug-08 20:16 
AnswerRe: Device ID Pin
Brij31-Aug-08 20:33
mentorBrij31-Aug-08 20:33 
GeneralRe: Device ID Pin
ellllllllie31-Aug-08 23:45
ellllllllie31-Aug-08 23:45 
QuestionHow to get commandline parameter from User Pin
Laji5931-Aug-08 17:35
Laji5931-Aug-08 17:35 
AnswerRe: How to get commandline parameter from User Pin
Vikram A Punathambekar31-Aug-08 18:34
Vikram A Punathambekar31-Aug-08 18:34 
AnswerRe: How to get commandline parameter from User Pin
Brij31-Aug-08 18:35
mentorBrij31-Aug-08 18:35 
AnswerRe: How to get commandline parameter from User Pin
Pete O'Hanlon31-Aug-08 22:50
mvePete O'Hanlon31-Aug-08 22:50 
Question[Message Deleted] Pin
Sunset Towers31-Aug-08 13:47
Sunset Towers31-Aug-08 13:47 
AnswerRe: Search a masterpages and pages at design time for controls. Pin
AhsanS1-Sep-08 1:02
AhsanS1-Sep-08 1:02 
QuestionWhat exactly does the '@' symbol do in front of a string? Pin
jacobjordan31-Aug-08 13:33
jacobjordan31-Aug-08 13:33 
AnswerRe: What exactly does the '@' symbol do in front of a string? Pin
Sunset Towers31-Aug-08 13:52
Sunset Towers31-Aug-08 13:52 
AnswerRe: What exactly does the '@' symbol do in front of a string? Pin
Eslam Afifi31-Aug-08 14:08
Eslam Afifi31-Aug-08 14:08 
GeneralRe: What exactly does the '@' symbol do in front of a string? Pin
jacobjordan31-Aug-08 14:57
jacobjordan31-Aug-08 14:57 

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.