By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,685 Members | 1,326 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,685 IT Pros & Developers. It's quick & easy.

import system.io

P: n/a
Hello all:

I have two forms in the project: form1, form2. form1 reads a file. form2
write data to that file. On form1 outside any class I am writing:

Import system.io

Right now I have also to write this again in form2 also.

If I have to use the file class in every form (in case I have 10 forms) do I
need to import this in every form or there is a way so that i could be
imported onces and be used by all the forms.

Thanks in advance!
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"Sender" <us**@domain.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello all:

I have two forms in the project: form1, form2. form1 reads a file. form2
write data to that file. On form1 outside any class I am writing:

Import system.io

Right now I have also to write this again in form2 also.

If I have to use the file class in every form (in case I have 10 forms) do I
need to import this in every form or there is a way so that i could be
imported onces and be used by all the forms.

Thanks in advance!


Go to the project properties and select Imports. Type System.IO in the textbox
marked Imports, and then click the add button. This will add system.io to the
global imports, and you won't have to type it in each file :)

Tom Shelton
Nov 20 '05 #2

P: n/a
In your project properties (right click your project name in solution
explorer and click properties) there is a heading called "Imports" You can
put global imports in that list
"Sender" <us**@domain.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello all:

I have two forms in the project: form1, form2. form1 reads a file. form2
write data to that file. On form1 outside any class I am writing:

Import system.io

Right now I have also to write this again in form2 also.

If I have to use the file class in every form (in case I have 10 forms) do I need to import this in every form or there is a way so that i could be
imported onces and be used by all the forms.

Thanks in advance!

Nov 20 '05 #3

P: n/a
"Sender" <us**@domain.com> scripsit:
I have two forms in the project: form1, form2. form1 reads a file. form2
write data to that file. On form1 outside any class I am writing:

Import system.io

Right now I have also to write this again in form2 also.

If I have to use the file class in every form (in case I have 10 forms) do I
need to import this in every form or there is a way so that i could be
imported onces and be used by all the forms.


Open the project's property window and add the namespace to the
"Imports" section ("General Properties").

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.