Click here to Skip to main content
15,908,264 members
Home / Discussions / C#
   

C#

 
GeneralRe: Screen Resolution Pin
SHaroz9-Jan-03 13:21
SHaroz9-Jan-03 13:21 
GeneralConsolizing a Windows Form program Pin
Le centriste8-Jan-03 9:38
Le centriste8-Jan-03 9:38 
GeneralRe: Consolizing a Windows Form program Pin
leppie8-Jan-03 11:28
leppie8-Jan-03 11:28 
GeneralRe: Consolizing a Windows Form program Pin
Le centriste9-Jan-03 3:56
Le centriste9-Jan-03 3:56 
GeneralRe: Consolizing a Windows Form program Pin
leppie9-Jan-03 6:05
leppie9-Jan-03 6:05 
GeneralRe: Consolizing a Windows Form program Pin
Le centriste9-Jan-03 19:38
Le centriste9-Jan-03 19:38 
GeneralNeed help Synchronizing Scrollbars Pin
bubbadurand8-Jan-03 9:19
bubbadurand8-Jan-03 9:19 
QuestionHow does a Component get its parent form Pin
charliedurrant8-Jan-03 8:34
charliedurrant8-Jan-03 8:34 
AnswerRe: How does a Component get its parent form Pin
Pete Bassett8-Jan-03 22:28
Pete Bassett8-Jan-03 22:28 
GeneralRe: How does a Component get its parent form Pin
charliedurrant9-Jan-03 6:07
charliedurrant9-Jan-03 6:07 
GeneralRe: How does a Component get its parent form Pin
leppie9-Jan-03 6:17
leppie9-Jan-03 6:17 
GeneralRe: How does a Component get its parent form Pin
James T. Johnson11-Jan-03 0:03
James T. Johnson11-Jan-03 0:03 
GeneralRe: How does a Component get its parent form Pin
James T. Johnson11-Jan-03 0:05
James T. Johnson11-Jan-03 0:05 
AnswerRe: How does a Component get its parent form Pin
James T. Johnson11-Jan-03 0:01
James T. Johnson11-Jan-03 0:01 
GeneralRe: How does a Component get its parent form Pin
leppie11-Jan-03 0:31
leppie11-Jan-03 0:31 
GeneralRe: How does a Component get its parent form Pin
James T. Johnson11-Jan-03 0:42
James T. Johnson11-Jan-03 0:42 
GeneralRe: How does a Component get its parent form Pin
leppie11-Jan-03 1:39
leppie11-Jan-03 1:39 
GeneralRe: How does a Component get its parent form Pin
Anonymous12-Jan-03 3:15
Anonymous12-Jan-03 3:15 
GeneralRe: How does a Component get its parent form Pin
leppie12-Jan-03 6:06
leppie12-Jan-03 6:06 
GeneralRe: How does a Component get its parent form Pin
James T. Johnson12-Jan-03 11:34
James T. Johnson12-Jan-03 11:34 
Anonymous wrote:
I want to get the Form at run time, the code suggested is for design time only

Thats the beauty of it though, the way it works is that at design time it gets assigned a reference to the form. Then when the Form designer goes to generate the code to recreate the component it sees that the property referencing the Form is not equal to the default value (null) so it serializes the property as a reference to the Form.

Even though the code to get the reference happens at design time, the reference is persisted by the designer. Then at run-time, when InitializeComponent is called on the Form it will reassign the reference to match the design-time state of the component.

Unfortunately this does no good if you want an easy solution for non-VS.NET/SharpDevelop users. As far as I know, there isn't any way to get the parent control that is hosting the component. And I'm not sure if there should be either because Components can be used anywhere, not necessarily used in conjunction with a Control/Form.

Sorry if I rambled, or didn't make sense I'm extremely tired and was just about to go to bed when I decided to check my e-mail.

James

"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation

GeneralRe: How does a Component get its parent form Pin
leppie13-Jan-03 6:18
leppie13-Jan-03 6:18 
QuestionToolbar Button Groups? Pin
Jamie Nordmeyer8-Jan-03 8:27
Jamie Nordmeyer8-Jan-03 8:27 
GeneralSpawn a commandline window with environment Pin
kman8-Jan-03 7:05
kman8-Jan-03 7:05 
GeneralRe: Spawn a commandline window with environment Pin
leppie8-Jan-03 7:36
leppie8-Jan-03 7:36 
GeneralRe: Spawn a commandline window with environment Pin
kman8-Jan-03 17:27
kman8-Jan-03 17:27 

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.