473,418 Members | 2,043 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Using Namespace in Visual Studio 2005

Hi,

Normally, I would use Namespace for all the window forms I created. With VS
2005, the code generated by the designer is hidden using partial keyword.

The question is, is there an efficient way to add any window forms created
into a namespace? Currently, I enclose the class for [filename].vb and
[filename].designer.vb inside a namespace manually.
Nov 23 '05 #1
4 4380
"Programatix" <N$*********************@msn.com> wrote in message
news:OS**************@tk2msftngp13.phx.gbl...
The question is, is there an efficient way to add any window
forms created into a namespace?


Change the Project Template (and accompanying script) to do
what you need. It /does/ take a bit of figuring out, not least
because the script's in a weakly-typed language so it's difficult
to know jsut which Classes you're actually playing with, but if
you're doing lots of this, I'd say it's /well/ worth the mileage.

That said, I've only done it with VS'2003 to date - yet to try it
with '2005. :-)

HTH,
Phill W.
Nov 23 '05 #2
I'm sorry to say that I don't understand your solution.

In VS 2003, code created by the Designer is generated into 1 file. Let's say
I added a WinForm. To put the new WinForm into a namespace, I just view the
code and enclose the whole class with the namespace I want. But in VS 2005,
code created by the Designer is seperated into 2 files (name ?.vb and
?.designer.vb). Each contain the partial code for the class. To put the
WinForm into a namespace, I need to open the 2 files and enclose the class
in the namespace.

So, the question is, is there any easier solution?

"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
news:dl**********@yarrow.open.ac.uk...
"Programatix" <N$*********************@msn.com> wrote in message
news:OS**************@tk2msftngp13.phx.gbl...
The question is, is there an efficient way to add any window
forms created into a namespace?


Change the Project Template (and accompanying script) to do
what you need. It /does/ take a bit of figuring out, not least
because the script's in a weakly-typed language so it's difficult
to know jsut which Classes you're actually playing with, but if
you're doing lots of this, I'd say it's /well/ worth the mileage.

That said, I've only done it with VS'2003 to date - yet to try it
with '2005. :-)

HTH,
Phill W.

Nov 23 '05 #3
Programatix,
| To put the
| WinForm into a namespace, I need to open the 2 files and enclose the class
| in the namespace.
|
| So, the question is, is there any easier solution?
None that I know of...

One possibility would be to move all the forms into their own project, that
has the namespace you like. However depending on the project that may be
over kill...

I would be curious how many beginner developers put individual forms in a
namespace. As I would consider it something more advanced developers would
do...

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Programatix" <N$*********************@msn.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
| I'm sorry to say that I don't understand your solution.
|
| In VS 2003, code created by the Designer is generated into 1 file. Let's
say
| I added a WinForm. To put the new WinForm into a namespace, I just view
the
| code and enclose the whole class with the namespace I want. But in VS
2005,
| code created by the Designer is seperated into 2 files (name ?.vb and
| ?.designer.vb). Each contain the partial code for the class. To put the
| WinForm into a namespace, I need to open the 2 files and enclose the class
| in the namespace.
|
| So, the question is, is there any easier solution?
|
| "Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
| news:dl**********@yarrow.open.ac.uk...
| > "Programatix" <N$*********************@msn.com> wrote in message
| > news:OS**************@tk2msftngp13.phx.gbl...
| >
| >> The question is, is there an efficient way to add any window
| >> forms created into a namespace?
| >
| > Change the Project Template (and accompanying script) to do
| > what you need. It /does/ take a bit of figuring out, not least
| > because the script's in a weakly-typed language so it's difficult
| > to know jsut which Classes you're actually playing with, but if
| > you're doing lots of this, I'd say it's /well/ worth the mileage.
| >
| > That said, I've only done it with VS'2003 to date - yet to try it
| > with '2005. :-)
| >
| > HTH,
| > Phill W.
| >
| >
|
|
Nov 23 '05 #4
The best reason is you can organize your forms into easier to find
namespaces for intellisense. C# users have the ability to put forms in a
folder and the form takes the namespace of the folder, but this is not true
for VB.NET. This is especially helpful for projects with lots of forms.

--
- Robert Beaubien
- President
- Kool Software
-
"Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
message news:uG**************@tk2msftngp13.phx.gbl...
Programatix,
| To put the
| WinForm into a namespace, I need to open the 2 files and enclose the
class
| in the namespace.
|
| So, the question is, is there any easier solution?
None that I know of...

One possibility would be to move all the forms into their own project,
that
has the namespace you like. However depending on the project that may be
over kill...

I would be curious how many beginner developers put individual forms in a
namespace. As I would consider it something more advanced developers would
do...

--
Hope this helps
Jay [MVP - Outlook]
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Programatix" <N$*********************@msn.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
| I'm sorry to say that I don't understand your solution.
|
| In VS 2003, code created by the Designer is generated into 1 file. Let's
say
| I added a WinForm. To put the new WinForm into a namespace, I just view
the
| code and enclose the whole class with the namespace I want. But in VS
2005,
| code created by the Designer is seperated into 2 files (name ?.vb and
| ?.designer.vb). Each contain the partial code for the class. To put the
| WinForm into a namespace, I need to open the 2 files and enclose the
class
| in the namespace.
|
| So, the question is, is there any easier solution?
|
| "Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
| news:dl**********@yarrow.open.ac.uk...
| > "Programatix" <N$*********************@msn.com> wrote in message
| > news:OS**************@tk2msftngp13.phx.gbl...
| >
| >> The question is, is there an efficient way to add any window
| >> forms created into a namespace?
| >
| > Change the Project Template (and accompanying script) to do
| > what you need. It /does/ take a bit of figuring out, not least
| > because the script's in a weakly-typed language so it's difficult
| > to know jsut which Classes you're actually playing with, but if
| > you're doing lots of this, I'd say it's /well/ worth the mileage.
| >
| > That said, I've only done it with VS'2003 to date - yet to try it
| > with '2005. :-)
| >
| > HTH,
| > Phill W.
| >
| >
|
|

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: MDoyle | last post by:
Here is the easiest question you’ll get all day from a complete newbie. I installed Visual Studio on my laptop last night and have been tryin to write my very first C# programs this morning. I’m...
14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
0
by: ME | last post by:
I can't seem to delete records using an objectdatasource. The object is a Typed Collection built by Visual Studio that access a SQL Database. When I try to delete using the ObjectDataSource it...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
1
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in...
2
by: lewisms | last post by:
Hello all, I am quite new to c++/. Net so please don't shoot me down for being a newbie. Any way I am trying to make a simple multithreading program that is just to learn the ideas behind it...
3
by: Marco Shaw | last post by:
I've got some C# code to create a custom PowerShell cmdlet with these statements: .... using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; .... ...
3
by: Johnson | last post by:
I just converted an ASP.NET Web Site to be an ASP.NET Web Application project type in Visual Studio 2005. After the conversion, the whole thing still works - it builds and the Web app runs just...
11
by: minishilpi | last post by:
I have a question - I have this code below to send an email and I have referenced the Microsoft CDO Library 2000. It doesn't throw any exception in the console window. It goes throughout the code...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.