Re: access a control in another form

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Dmitriy Lapshin [C# / .NET MVP] (x-code_at_no-spam-please.hotpop.com)
Date: 01/31/05


Date: Mon, 31 Jan 2005 18:12:49 +0200

Hi,

>How to access a control in another form

There's a property for each control determining its visibility outside the
form class. It's 'private' by default, you can change it to 'internal' or
'public' for the control field to become visible outside the form class.
Or, declare a public property on the form class returning the reference to
the control in question.

> how to make a form become a MDI container.

There's a dedicated property on the form serving just this purpose -
IsMdiContainer.

-- 
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx
"authorking" <authorking2002@hotmail.com> wrote in message 
news:eYBQiJ4BFHA.3336@TK2MSFTNGP11.phx.gbl...
> How to access a control in another form and how to make a form become a 
> MDI container.
> 


Relevant Pages

  • RE: Asynchronous Operation
    ... Thanks Peter, ... method within a form class and the method and the delegate both reside in the ... I want the data binding to be asynchronous so GUI control will return to the ...
    (microsoft.public.dotnet.framework)
  • Re: Unofficial patch for QC#14007
    ... I used your patch for QC ... Control Class: TEditControl ... Type: Microsoft Windows XP ... Form Class: TFormEditPadLite ...
    (borland.public.delphi.non-technical)
  • Re: Newbie: Can Buttons on Form never have focus?
    ... If you have any control on the form ... > private void button_Enter(object sender, ... > on the form) is method of the form class: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Mouse event handlers
    ... handlers would mean attaching to the Forms mouse event handlers. ... If you want to write the code in the form class then do something like ... Since the sender is of type object, make sure you cast sender as control ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Global Functions accessible to all classes in C#
    ... Can you paste some code of your control array classes and how do you affix ... If you add the controls on the form in the control collection of the control ... > them to a form class. ... > For example when I try to change the BackColor of an instance of a TextBox ...
    (microsoft.public.dotnet.languages.csharp)