473,789 Members | 3,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4395
"Programati x" <N$************ *********@msn.c om> wrote in message
news:OS******** ******@tk2msftn gp13.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...
"Programati x" <N$************ *********@msn.c om> wrote in message
news:OS******** ******@tk2msftn gp13.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
"Programati x" <N$************ *********@msn.c om> wrote in message
news:%2******** ********@TK2MSF TNGP14.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...
| > "Programati x" <N$************ *********@msn.c om> wrote in message
| > news:OS******** ******@tk2msftn gp13.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******** ******@tk2msftn gp13.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
"Programati x" <N$************ *********@msn.c om> wrote in message
news:%2******** ********@TK2MSF TNGP14.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...
| > "Programati x" <N$************ *********@msn.c om> wrote in message
| > news:OS******** ******@tk2msftn gp13.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
2935
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 running into few issues that I’m sure someone on this forum will be able to help m understand quickly. I started out with a traditional “Hello World” program, again, my firs C# programs. I was surprised to see how the System namespace wa...
14
5804
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 SQL DATABASE, probably by the click of a button. Is this possible? & what is the BEST APPROACH for doing this? & also if any links are there do tell those to me too coz I have no idea how to go about doing it.
0
1196
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 displays a message that says: Value cannot be null. Parameter name: Original_Description This URL is supposed to be a documented titled "Data Deletion Using the ObjectDataSource Control" but it doesn't seem to work (as of posting)....
53
4758
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, and .Net2005 code. I'm developing in vb.net 2005. This test sub just reads an input text file, writing out records to another text file, eliminating records that have a '99' in them (it is similar to a CSV file). Some of my concerns are:
1
3602
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 some files and work on it. Let say, I want add new page to web project named websiteOrder.sln, i will open websiteOrder.sln in my local computer, connected to websiteOrder.sln located in Visual Source Safe 6.0(source safe located in another...
2
4409
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 (before I incorporate them in another program). I just can’t seem to get a non-static call to work in my thread that has access to the Form1 variables and controls I need. I can call a non-static function using another class but then I can seem to get in...
3
16166
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; .... My compile fails using csc.exe:
3
5490
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 fine. However, none of the classes are placed explicitly in any namespace. The ASP.NET Web Site project type apparentlyl infers namespace from the site's directory structure. But Visual Studio's conversion process ("Convert to Web Application") does...
11
4472
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 successfully, but I do not receive any email. When I execute this code to send email, it gives the following error - 'ConsoleApplication1.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll',...
0
9511
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10408
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10139
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6768
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.