Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
QuestionManaging multiple controls [modified] Pin
Electric Eddy9-Sep-11 13:51
Electric Eddy9-Sep-11 13:51 
AnswerRe: Managing multiple controls Pin
Philippe Mori9-Sep-11 14:21
Philippe Mori9-Sep-11 14:21 
AnswerRe: Managing multiple controls Pin
BillWoodruff9-Sep-11 14:29
professionalBillWoodruff9-Sep-11 14:29 
AnswerRe: Managing multiple controls Pin
Eddy Vluggen10-Sep-11 12:57
professionalEddy Vluggen10-Sep-11 12:57 
GeneralRe: Managing multiple controls Pin
BillWoodruff10-Sep-11 20:09
professionalBillWoodruff10-Sep-11 20:09 
GeneralRe: Managing multiple controls Pin
Eddy Vluggen11-Sep-11 1:37
professionalEddy Vluggen11-Sep-11 1:37 
GeneralRe: Managing multiple controls Pin
BillWoodruff11-Sep-11 2:44
professionalBillWoodruff11-Sep-11 2:44 
GeneralRe: Managing multiple controls Pin
Eddy Vluggen11-Sep-11 2:52
professionalEddy Vluggen11-Sep-11 2:52 
BillWoodruff wrote:
What is "discarded" is the entire "design and intelligence" that (hopefully) went into creating a collection of Controls on a Panel (or Form, or UserControl). Which includes placement, z-order, tab-order, docking, anchoring, etc.

Not notably different from a UserControl, and somewhat easier to manage at times.

BillWoodruff wrote:
Yes, you could write code to copy all the Controls in a Panel into an Array (using CopyTo(Control[], index)), and you could loop through that array, and, hopefully, restore the Panel's controls to a previous configuration: but what a waste of time and code ... when all you have to do is hide the whole Panel, or fill it, temporarily, with some other container that hides the 'original controls.'

I didn't mention copying controls. Merely instantiate the Form/UserControl and assign it to a container that's serving as a a placeholder.

BillWoodruff wrote:
Forms are 'expensive,' and I think the way you have advocated using them here is an example of how to mis-use Forms.

They're more expensive than a Panel, but in turn they offer a bit more design-time flexibility. Yes, a BackGroundWorker is more expensive than a Thread, but the tradeoff can be worth it. That's why we don't code in C at this moment Smile | :)

BillWoodruff wrote:
and the use of Forms within Forms is just bad practice

Since when? Have you taken a look at the VS-IDE?
Bastard Programmer from Hell Suspicious | :suss:

QuestionVS2008 WMP Issue wirh user privileges Pin
Martin Wasley9-Sep-11 12:22
Martin Wasley9-Sep-11 12:22 
AnswerRe: VS2008 WMP Issue wirh user privileges Pin
TheGreatAndPowerfulOz12-Sep-11 11:34
TheGreatAndPowerfulOz12-Sep-11 11:34 
QuestionJust wondering..c# online Pin
stephen.darling9-Sep-11 6:48
stephen.darling9-Sep-11 6:48 
AnswerRe: Just wondering..c# online Pin
AspDotNetDev9-Sep-11 7:13
protectorAspDotNetDev9-Sep-11 7:13 
GeneralRe: Just wondering..c# online Pin
stephen.darling9-Sep-11 7:17
stephen.darling9-Sep-11 7:17 
GeneralRe: Just wondering..c# online Pin
AspDotNetDev9-Sep-11 7:32
protectorAspDotNetDev9-Sep-11 7:32 
GeneralRe: Just wondering..c# online Pin
stephen.darling9-Sep-11 8:12
stephen.darling9-Sep-11 8:12 
GeneralRe: Just wondering..c# online Pin
Richard MacCutchan9-Sep-11 21:28
mveRichard MacCutchan9-Sep-11 21:28 
GeneralRe: Just wondering..c# online Pin
stephen.darling10-Sep-11 3:04
stephen.darling10-Sep-11 3:04 
AnswerRe: Just wondering..c# online Pin
BillWoodruff9-Sep-11 14:37
professionalBillWoodruff9-Sep-11 14:37 
GeneralRe: Just wondering..c# online Pin
stephen.darling10-Sep-11 3:04
stephen.darling10-Sep-11 3:04 
AnswerRe: Just wondering..c# online Pin
jschell10-Sep-11 8:14
jschell10-Sep-11 8:14 
GeneralRe: Just wondering..c# online Pin
stephen.darling10-Sep-11 8:24
stephen.darling10-Sep-11 8:24 
QuestionPacking optimisation code/alogrithm required Pin
_awatts9-Sep-11 2:37
_awatts9-Sep-11 2:37 
AnswerRe: Packing optimisation code/alogrithm required Pin
Luc Pattyn9-Sep-11 4:12
sitebuilderLuc Pattyn9-Sep-11 4:12 
GeneralRe: Packing optimisation code/alogrithm required Pin
_awatts9-Sep-11 5:45
_awatts9-Sep-11 5:45 
GeneralRe: Packing optimisation code/alogrithm required Pin
MicroVirus9-Sep-11 13:03
MicroVirus9-Sep-11 13:03 

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.