Click here to Skip to main content
15,897,187 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 
I am having a great deal of trouble with what on the surface seems simple. I am writing a Component (not a Control) which needs to access the Form on which it is contained,

<br />
public class Resizer : System.ComponentModel.Component<br />
{	<br />
  public Resizer(System.ComponentModel.IContainer container)<br />
  {			<br />
     container.Add(this);<br />
     InitializeComponent();	<br />
     <br />
     Need to get the form ......<br />


I need no designer interface hence the inheritance from Component. Does anyone have any ideas of how to get the Form? I have looked at ISite and tried

<br />
<br />
Form c = (Form)this.Site.GetService(typeof(Form)); <br />
<br />


I wish to emulate the design time appearance of the timer component so explictly don't want to inherit from Control and set Visible to false


Cry | :((
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 
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.