Click here to Skip to main content
15,892,805 members
Home / Discussions / C#
   

C#

 
GeneralRe: Base Class Pin
N8tiv23-Oct-13 20:34
N8tiv23-Oct-13 20:34 
QuestionOne database and Multiple users ...? Pin
Pdeveloper23-Oct-13 0:16
Pdeveloper23-Oct-13 0:16 
AnswerRe: One database and Multiple users ...? Pin
Pete O'Hanlon23-Oct-13 1:08
mvePete O'Hanlon23-Oct-13 1:08 
GeneralRe: One database and Multiple users ...? Pin
Pdeveloper23-Oct-13 1:21
Pdeveloper23-Oct-13 1:21 
GeneralRe: One database and Multiple users ...? Pin
David C# Hobbyist.23-Oct-13 3:47
professionalDavid C# Hobbyist.23-Oct-13 3:47 
GeneralRe: One database and Multiple users ...? Pin
Ravi Bhavnani23-Oct-13 12:15
professionalRavi Bhavnani23-Oct-13 12:15 
AnswerRe: One database and Multiple users ...? Pin
Abhinav S23-Oct-13 18:53
Abhinav S23-Oct-13 18:53 
QuestionC# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
BillWoodruff23-Oct-13 0:15
professionalBillWoodruff23-Oct-13 0:15 
I have "bought into" the view that programmers in WinForms should not put a Form inside a Form. My reasoning has gone something like this: [1]

1. A Form is a "heavy-weight" object; using "lighter-weight" objects. like a Panel on the Form, a UserControl (for re-usability), or other ContainerControl(s) on the Form, is better practice. And, I believe the idea of using a TabControl to implement a multi-document work-space is a good one.

2. A Form within a Form (if it is movable: that is, if it has a TitleBar) can easily be moved at run-time so almost all of it is "outside" its Parent Form. It's actually possible to "lose track," visually, of a Form within a Form if: you do "just the wrong thing" while the outer Form is Maximized, and then set the Form WindowState back to 'Normal. Of course, the programmer, can easily write code to control for such cases.

3. Particularly for newcomers to programming in WinForms, putting a Form in a Form is "bad practice" that leads to programming errors, hair growing on the palms, etc.

If I consider what, if any, advantages there might be to using a Form within a Form, I find it hard to come up with anything tangible. Using multiple independent windows (Forms) in an app: yes, I can see that (and I write apps that way); each Form can have its own Opacity value, for example. And, the programmer, with a small amount of effort, can implement docking of the independent Forms to their "main Form," or other Forms, etc.

Based on the belief that questioning one's technical assumptions (frequently) is a healthy thing to do, I'm curious to ask you, my peers, and betters, what you think about putting Forms inside Forms:

1. is it something you do yourself in your own practice (in situations you are not using MDI) ?

2. is it a very "bad thing" in terms of consuming resources (like memory) compared other possible containers ? Does it diminish performance ?

3. do you think it is a mistake for beginning programmers to use Forms inside Forms ?

all-ears, bill

[1] I've left MDI out of this discussion, even though CP is still getting questions on MDI: questions from people working with/on legacy apps; and, questions that I believe are coming from students who are assigned to create an MDI app in their classes. I go along with the view that MDI is outmoded, and read that MS has "deprecated" it. Bias: I find MDI apps butt-ugly.

Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview

AnswerRe: C# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
GuyThiebaut23-Oct-13 2:02
professionalGuyThiebaut23-Oct-13 2:02 
GeneralRe: C# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
N8tiv23-Oct-13 13:04
N8tiv23-Oct-13 13:04 
AnswerRe: C# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
Richard MacCutchan23-Oct-13 3:27
mveRichard MacCutchan23-Oct-13 3:27 
AnswerRe: C# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
Eddy Vluggen23-Oct-13 5:12
professionalEddy Vluggen23-Oct-13 5:12 
GeneralRe: C# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
Ravi Bhavnani23-Oct-13 12:06
professionalRavi Bhavnani23-Oct-13 12:06 
GeneralRe: C# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
Eddy Vluggen23-Oct-13 20:41
professionalEddy Vluggen23-Oct-13 20:41 
GeneralRe: C# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
BillWoodruff23-Oct-13 18:39
professionalBillWoodruff23-Oct-13 18:39 
AnswerRe: C# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
Eddy Vluggen23-Oct-13 22:34
professionalEddy Vluggen23-Oct-13 22:34 
GeneralRe: C# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
BillWoodruff24-Oct-13 17:49
professionalBillWoodruff24-Oct-13 17:49 
AnswerRe: C# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
Ravi Bhavnani23-Oct-13 12:12
professionalRavi Bhavnani23-Oct-13 12:12 
GeneralRe: C# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
BillWoodruff23-Oct-13 18:52
professionalBillWoodruff23-Oct-13 18:52 
GeneralRe: C# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
joost.versteegen24-Oct-13 3:23
joost.versteegen24-Oct-13 3:23 
GeneralRe: C# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
BillWoodruff24-Oct-13 17:48
professionalBillWoodruff24-Oct-13 17:48 
AnswerRe: C# WinForms: Is putting a Form inside a Form a "Bad Thing" ? Pin
WuRunZhe30-Oct-13 14:50
WuRunZhe30-Oct-13 14:50 
Questionclosing second form without closing first form Pin
alfie.max1522-Oct-13 23:34
alfie.max1522-Oct-13 23:34 
AnswerRe: closing second form without closing first form Pin
BillWoodruff23-Oct-13 2:20
professionalBillWoodruff23-Oct-13 2:20 
GeneralRe: closing second form without closing first form Pin
alfie.max1524-Oct-13 7:21
alfie.max1524-Oct-13 7:21 

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.