Click here to Skip to main content
15,919,879 members
Home / Discussions / C#
   

C#

 
AnswerRe: Reading from serial port Pin
PIEBALDconsult24-Oct-13 17:32
mvePIEBALDconsult24-Oct-13 17:32 
QuestionI need help with control inheritance Pin
deebow24-Oct-13 4:39
deebow24-Oct-13 4:39 
AnswerRe: I need help with control inheritance Pin
OriginalGriff24-Oct-13 5:02
mveOriginalGriff24-Oct-13 5:02 
GeneralRe: I need help with control inheritance Pin
BillWoodruff24-Oct-13 6:07
professionalBillWoodruff24-Oct-13 6:07 
AnswerRe: I need help with control inheritance Pin
BillWoodruff24-Oct-13 6:02
professionalBillWoodruff24-Oct-13 6:02 
GeneralRe: I need help with control inheritance Pin
OriginalGriff24-Oct-13 6:25
mveOriginalGriff24-Oct-13 6:25 
GeneralRe: I need help with control inheritance Pin
deebow24-Oct-13 6:44
deebow24-Oct-13 6:44 
GeneralRe: I need help with control inheritance Pin
BillWoodruff24-Oct-13 16:56
professionalBillWoodruff24-Oct-13 16:56 
I'd like to help you with this, but what you observe is different than what I observe in Visual Studio 2012 (and what I observe is also different from what OriginalGriff observes).

I don't understand this:
 B) Form that contains an instance of Usercontrol A
Class FormWhatever : UserControl
If you create a Form, and then set it to inherit from a UserControl, it is no longer a Form, but a UserControl ! Yes, you can put an instance of the same UserControl that a Class inherits from "in/on" the same UserControl, but, why would you ? You've created the equivalent of a person holding a tv-screen showing a picture of themselves Smile | :)

And, this:
2) The form that is loaded at program start is the usercontrol.
You cannot start a WinForms .NET program with a UserControl: you'll get a compile-time error like this: "Error 2 Argument 1: cannot convert from '...UserControl.Form#' to 'System.Windows.Forms.Form"

And, this:
The base control isn't loaded unless the user chooses to go into that form.
what do you mean by "go into that Form" ?

If your goal here is to provide all the secondary Forms in your Application with a common search facility, and you wish to use a "Main Form" as a kind of "master-controller" from which you show the secondary Forms:

1. create a new WinForms app: design your Main Form

2. create a new UserControl: design it. implement Public Properties, Methods, etc., ... or Events ... so that consumers of the UserControl can use/access information inside the UserControl

3. create a secondary Form template which will serve as a base for all secondary Forms: put an instance of the UserControl on it. Do not "show" this template Form. this Form should not inherit from anything.

4. at design-time, you can define new instances of the secondary Form template by setting them to inherit from the secondary Form template rather than "Form."

5. or, at run-time, you can create new instances of the secondary Form Template as needed in response to the end-user's actions, and display them on screen where you want them.

What you may need to do to "keep track" of any secondary Forms which have been created at run-time may vary depending on what your Application does.

Keep it simple, keep it clean, and prepare to be confused Smile | :)

bill

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

Questionhow to create stetmen foreach gridcontrol devexpress Pin
Member 1027082523-Oct-13 23:19
Member 1027082523-Oct-13 23:19 
QuestionRe: how to create stetmen foreach gridcontrol devexpress Pin
Richard MacCutchan23-Oct-13 23:27
mveRichard MacCutchan23-Oct-13 23:27 
AnswerRe: how to create stetmen foreach gridcontrol devexpress Pin
OriginalGriff23-Oct-13 23:54
mveOriginalGriff23-Oct-13 23:54 
AnswerRe: how to create stetmen foreach gridcontrol devexpress Pin
Eddy Vluggen24-Oct-13 0:30
professionalEddy Vluggen24-Oct-13 0:30 
QuestionRoulette wheel selection Pin
Member 995886723-Oct-13 17:16
Member 995886723-Oct-13 17:16 
AnswerRe: Roulette wheel selection Pin
Abhinav S23-Oct-13 20:24
Abhinav S23-Oct-13 20:24 
GeneralRe: Roulette wheel selection Pin
Dave Kreskowiak24-Oct-13 3:21
mveDave Kreskowiak24-Oct-13 3:21 
GeneralRe: Roulette wheel selection Pin
Abhinav S24-Oct-13 3:51
Abhinav S24-Oct-13 3:51 
GeneralRe: Roulette wheel selection Pin
Pete O'Hanlon24-Oct-13 3:53
mvePete O'Hanlon24-Oct-13 3:53 
GeneralRe: Roulette wheel selection Pin
Dave Kreskowiak24-Oct-13 6:32
mveDave Kreskowiak24-Oct-13 6:32 
GeneralBase Class Pin
N8tiv23-Oct-13 12:57
N8tiv23-Oct-13 12:57 
AnswerRe: Base Class Pin
Abhinav S23-Oct-13 18:52
Abhinav S23-Oct-13 18:52 
GeneralRe: Base Class Pin
Bernhard Hiller23-Oct-13 20:25
Bernhard Hiller23-Oct-13 20:25 
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 

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.