Article View: borland.public.csharpbuilder.language.csharp
Article #484Re: Newbe question
From: Lars O. Soderstrom
Date: Sat, 22 Jan 2005 08:30
Date: Sat, 22 Jan 2005 08:30
41 lines
1978 bytes
1978 bytes
I get a "Cannot access ALE.frmMain.Startup.Main() because of it's security
level" (translated from swedish) compiler error message pointing to setting
Startup.main.Text:
private void button2_Click(object sender, System.EventArgs e)
{
Startup.main.Text = "Some text";
}
What am I missing?
Thanks,
Lars
"Marc Rohloff [TeamB]" <"on request"> skrev i meddelandet
news:1e1tpld5n2og5.dlg@marcrohloff.40tude.net...
> On Fri, 21 Jan 2005 19:12:11 +0100, Lars O. Soderstrom wrote:
>
>> How do you refer to the main form?
> Just save it in a static field somewhere.
>
> class Startup {
> public static frmMain main;
>
> static void Main()
> {
> main = new frmMain();
> Application.Run(main);
> }
> }
>
>
> private void button2_Click(object sender, System.EventArgs e)
> {
> Startup.main.Text = "Some text";
> }
>
>
> --
> Marc Rohloff [TeamB]
> marc rohloff -at- myrealbox -dot- com
Technical Details
Message-ID:
<41f20f21$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41f145f9@newsgroups.borland.com> <1e1tpld5n2og5.dlg@marcrohloff.40tude.net>Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,96ed0e9698357d80 X-Google-Attributes: gid1efe35,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Lars O. Soderstrom" <elless.prodata@telia.com> From: "Lars O. Soderstrom" <elless.prodata@telia.com> Newsgroups: borland.public.csharpbuilder.language.csharp References: <41f145f9@newsgroups.borland.com> <1e1tpld5n2og5.dlg@marcrohloff.40tude.net> Subject: Re: Newbe question Date: Sat, 22 Jan 2005 09:30:24 +0100 Lines: 43 Organization: Elless Prodata AB X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 68.56.49.230 Message-ID: <41f20f21$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1106382625 68.56.49.230 (22 Jan 2005 00:30:25 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail