Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: Arithmetic operation resulted in an overflow. Pin
Daniel Grunwald2-Jan-10 10:53
Daniel Grunwald2-Jan-10 10:53 
GeneralRe: Arithmetic operation resulted in an overflow. Pin
harold aptroot2-Jan-10 10:56
harold aptroot2-Jan-10 10:56 
GeneralRe: Arithmetic operation resulted in an overflow. Pin
Daniel Grunwald2-Jan-10 10:58
Daniel Grunwald2-Jan-10 10:58 
GeneralRe: Arithmetic operation resulted in an overflow. Pin
harold aptroot2-Jan-10 11:02
harold aptroot2-Jan-10 11:02 
Questionpassing a form to User Control(dll) from textbox Pin
jojoba20102-Jan-10 0:21
jojoba20102-Jan-10 0:21 
GeneralRe: passing a form to User Control(dll) from textbox Pin
Abhinav S2-Jan-10 0:24
Abhinav S2-Jan-10 0:24 
GeneralRe: passing a form to User Control(dll) from textbox Pin
DaveyM692-Jan-10 2:27
professionalDaveyM692-Jan-10 2:27 
AnswerRe: passing a form to User Control(dll) from textbox Pin
DaveyM692-Jan-10 2:23
professionalDaveyM692-Jan-10 2:23 
You can use the Parent property to access the container the user control is in - this may or may not be a form... it could be a groupbox, a panel etc, you can check by using is or as. If it's not a form, check the parent's parent etc etc...

This is normally the wrong way round of doing things though as you will effectively be coupling your user control to a form and if you want to manipulate other controls on the form then you will be coupling to those too. If your control is then used in a different container and/or the expected controls aren't present you will end up with problems. A better solution is to expose events, properties and methods in your user control that it's host form can access, then the host form can control all it's controls including your user control.

If you are wanting a 'controller' form with your user control acting as the controller - you would be better to create a custom form for this purpose rather than a user control IMO.

Dave

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus)

QuestionRe: passing a form to User Control(dll) from textbox [modified] Pin
jojoba20102-Jan-10 3:10
jojoba20102-Jan-10 3:10 
QuestionHow to draw a circle in C# Pin
ksaw1231-Jan-10 21:47
ksaw1231-Jan-10 21:47 
AnswerRe: How to draw a circle in C# Pin
venomation1-Jan-10 22:31
venomation1-Jan-10 22:31 
GeneralRe: How to draw a circle in C# Pin
venomation1-Jan-10 22:36
venomation1-Jan-10 22:36 
GeneralRe: How to draw a circle in C# Pin
ksaw1232-Jan-10 0:21
ksaw1232-Jan-10 0:21 
GeneralRe: How to draw a circle in C# Pin
DaveyM692-Jan-10 2:34
professionalDaveyM692-Jan-10 2:34 
QuestionRe: How to draw a circle in C# Pin
Luc Pattyn2-Jan-10 3:05
sitebuilderLuc Pattyn2-Jan-10 3:05 
AnswerRe: How to draw a circle in C# [modified] Pin
DaveyM692-Jan-10 3:14
professionalDaveyM692-Jan-10 3:14 
QuestionLicence key Generate Pin
@nisha 2n1-Jan-10 21:36
@nisha 2n1-Jan-10 21:36 
AnswerRe: Licence key Generate Pin
venomation1-Jan-10 22:26
venomation1-Jan-10 22:26 
AnswerRe: Licence key Generate Pin
Pete O'Hanlon1-Jan-10 22:47
mvePete O'Hanlon1-Jan-10 22:47 
QuestionCreating trial version software Pin
Milind Panchal1-Jan-10 21:28
Milind Panchal1-Jan-10 21:28 
AnswerRe: Creating trial version software Pin
venomation1-Jan-10 22:22
venomation1-Jan-10 22:22 
GeneralRe: Creating trial version software Pin
Dave Kreskowiak2-Jan-10 9:30
mveDave Kreskowiak2-Jan-10 9:30 
GeneralRe: Creating trial version software Pin
venomation2-Jan-10 12:25
venomation2-Jan-10 12:25 
AnswerRe: Creating trial version software Pin
Isaac Gordon1-Jan-10 22:37
Isaac Gordon1-Jan-10 22:37 
QuestionCombobox in C# Pin
Anu_Bala1-Jan-10 17:59
Anu_Bala1-Jan-10 17:59 

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.