Click here to Skip to main content
15,920,603 members
Home / Discussions / C#
   

C#

 
GeneralConverting string to bitmap Pin
jawbrey2-Dec-04 5:15
jawbrey2-Dec-04 5:15 
GeneralRe: Converting string to bitmap Pin
Heath Stewart2-Dec-04 7:17
protectorHeath Stewart2-Dec-04 7:17 
GeneralBrowse all controls Pin
bouli2-Dec-04 4:34
bouli2-Dec-04 4:34 
GeneralRe: Browse all controls Pin
Judah Gabriel Himango2-Dec-04 4:58
sponsorJudah Gabriel Himango2-Dec-04 4:58 
GeneralRe: Browse all controls Pin
bouli2-Dec-04 5:02
bouli2-Dec-04 5:02 
GeneralRe: Browse all controls Pin
Heath Stewart2-Dec-04 5:20
protectorHeath Stewart2-Dec-04 5:20 
GeneralRe: Browse all controls Pin
bouli2-Dec-04 5:30
bouli2-Dec-04 5:30 
GeneralRe: Browse all controls Pin
Heath Stewart2-Dec-04 5:35
protectorHeath Stewart2-Dec-04 5:35 
Making such generalized assumptions is not a good practice. The recursive method would be best to implement now in case someday you add a composite control - like a UserControl - to your form. I merely adds an extra 1 or 2 calls to the call stack depending on the state, but still enumerates your first level controls as did the first example.

an even better approach and recursive in nature is to extend a control class and override Enable to also have it disable its children (some controls do this inherently, like the ComboBox). Then when its children are disabled they disable their children. Now your code isn't responsible for its children and you have a better OO design.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: Browse all controls Pin
Judah Gabriel Himango2-Dec-04 5:37
sponsorJudah Gabriel Himango2-Dec-04 5:37 
GeneralRe: Browse all controls Pin
Heath Stewart2-Dec-04 7:30
protectorHeath Stewart2-Dec-04 7:30 
GeneralRe: Browse all controls Pin
turbochimp2-Dec-04 5:08
turbochimp2-Dec-04 5:08 
GeneralProblem with string literals Pin
pchak2-Dec-04 4:18
pchak2-Dec-04 4:18 
GeneralRe: Problem with string literals Pin
turbochimp2-Dec-04 4:50
turbochimp2-Dec-04 4:50 
GeneralRe: Problem with string literals Pin
pchak2-Dec-04 5:30
pchak2-Dec-04 5:30 
Generalconnection path for database Pin
steve_rm2-Dec-04 4:18
steve_rm2-Dec-04 4:18 
GeneralRe: connection path for database Pin
turbochimp2-Dec-04 4:35
turbochimp2-Dec-04 4:35 
GeneralRe: connection path for database Pin
steve_rm2-Dec-04 5:20
steve_rm2-Dec-04 5:20 
Generalusing a TextBox without focus Pin
jjansen2-Dec-04 4:14
jjansen2-Dec-04 4:14 
GeneralC# compact framework Yes/No MessageBox Pin
DanielFP2-Dec-04 3:50
DanielFP2-Dec-04 3:50 
GeneralRe: C# compact framework Yes/No MessageBox Pin
Dave Kreskowiak2-Dec-04 5:42
mveDave Kreskowiak2-Dec-04 5:42 
GeneralRe: C# compact framework Yes/No MessageBox Pin
Daniel P2-Dec-04 6:55
Daniel P2-Dec-04 6:55 
Generalfilling RichTextBox using MemoryStream Pin
Hovik Melkomian2-Dec-04 3:50
Hovik Melkomian2-Dec-04 3:50 
GeneralRe: filling RichTextBox using MemoryStream Pin
leppie2-Dec-04 4:47
leppie2-Dec-04 4:47 
GeneralRe: filling RichTextBox using MemoryStream Pin
Hovik Melkomian4-Dec-04 1:55
Hovik Melkomian4-Dec-04 1:55 
GeneralRe: filling RichTextBox using MemoryStream Pin
leppie4-Dec-04 2:23
leppie4-Dec-04 2:23 

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.