🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.language.csharp
Article #512

Re: Programing C#

#512
From: David Clegg
Date: Fri, 05 Nov 2004 19:48
47 lines
2450 bytes
Lucio Chiessi wrote:

> Form1.Show();
> 
>             With this the compiler shows an error like this: " are you
> missing directive or assembly reference "

A couple of points:

You need to create an instance of Form1 before showing it e.g

Form1 form = new Form1();
form.Show();

You also need to ensure you have referenced the namespace in the unit
where MainForm is declared, if it is declared in a different namespace.
This is done by adding a 'using' statement to the top of the unit e.g.

using MyNamespaceContainingForm1;

Alternatively you can fully qualify the Form1 reference when declaring
it e.g

MyNamespaceContainingForm1.Form1 form = new Form1();

You also need to ensure that you've added a reference to the assembly
containing the Form1 implementation, if it isn't a unit included
directly in your current project. This is done by selecting
'Project|Add Reference' on the IDEs main menu.

HTH.

-- 
Cheers,
David Clegg
dclegg_at_ebetonline_dot_com

Vote 1 http://cc.borland.com/codecentral/ccweb.exe/listing?id=21489 :-)
Now supports Google Groups searching with Dyna-extend(tm) technology!

QualityCentral. The best way to bug Borland about bugs.
http://qc.borland.com

"Marge, you being a cop makes you the man! Which makes me the woman --
and I have no interest in that, besides occasionally wearing the
underwear, which as we discussed, is strictly a comfort thing." - Homer
Simpson
Technical Details
Message-ID: <xn0dpfpxo36527001@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <2v1vmaF2fd1o0U1@uni-berlin.de>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,980c19852d686e8c
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "David Clegg" <dclegg@gmail.com>
Subject: Re: Programing C#
Newsgroups: borland.public.csharpbuilder.language.csharp
References:  <2v1vmaF2fd1o0U1@uni-berlin.de>
Organization: eBet Limited
User-Agent: XanaNews/1.16.4.6
X-Face: d0!4zUWIBj<CO5m0`=Vu"m.2)(~|1-4:I]5n5<OE<hv+kK)Z:n<h&MnW9t_{}>cw&gbV#f>
 mHS4h1mcw[cz:R#J,T;)w/($:2Vl5CQnFP(c\wmN0rSvn25.kmVpCmqb]gj7l9ZP+O4+a+P~L#]4s"
 "Tx^zQ/N"#'/?lV?SHpdR\5(iNj.,I_YMfF=/_3.JWAs3
Message-ID: <xn0dpfpxo36527001@newsgroups.borland.com>
X-Ref: newsgroups.borland.com ~XNS:00000875
NNTP-Posting-Host: 211.29.253.123
Date: 5 Nov 2004 12:48:19 -0700
X-Trace: newsgroups.borland.com 1099687699 211.29.253.123 (5 Nov 2004 12:48:19 -0700)
Lines: 47
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail