Hi all,
I have a Form called "Main":
Public Class Main
Private Sub Button1_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click
End Sub
End Class
Now I want to put the form into a namespace called "Forms". If I put the
lines "Namespace Forms" and "end namespace" before and after the code above,
I get an error at the "Handles" clause. Reason: The "Partial Class" in
Main.Designer.vb is still in the old Namespace. Consequently the class in
Main.vb is a different class not having any buttons anymore, therefore the
error.
Now I could manually also put the whole "Partial Class" into the "Forms"
namespace, but as the file is "designer generated" I can not touch it (or
take the risk that my lines will be overwritten).
So, how do I move a Form into a namespace in VB 2005? This was no problem in
VB 2003 because it was all one file.
Armin 7 2940
On 2007-02-11, Armin Zingler <az*******@freenet.dewrote:
Hi all,
I have a Form called "Main":
Public Class Main
Private Sub Button1_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click
End Sub
End Class
Now I want to put the form into a namespace called "Forms". If I put the
lines "Namespace Forms" and "end namespace" before and after the code above,
I get an error at the "Handles" clause. Reason: The "Partial Class" in
Main.Designer.vb is still in the old Namespace. Consequently the class in
Main.vb is a different class not having any buttons anymore, therefore the
error.
Now I could manually also put the whole "Partial Class" into the "Forms"
namespace, but as the file is "designer generated" I can not touch it (or
take the risk that my lines will be overwritten).
So, how do I move a Form into a namespace in VB 2005? This was no problem in
VB 2003 because it was all one file.
Armin
Just change it and make your default namespace the new namespace. You should
have a problem with it... At least, I haven't in c# :)
--
Tom Shelton
"Tom Shelton" <to*********@comcastXXXXXXX.netschrieb
On 2007-02-11, Armin Zingler <az*******@freenet.dewrote:
Hi all,
I have a Form called "Main":
Public Class Main
Private Sub Button1_Click( _
ByVal sender As System.Object, ByVal e As
System.EventArgs) _ Handles Button1.Click
End Sub
End Class
Now I want to put the form into a namespace called "Forms". If I
put the lines "Namespace Forms" and "end namespace" before and
after the code above, I get an error at the "Handles" clause.
Reason: The "Partial Class" in Main.Designer.vb is still in the
old Namespace. Consequently the class in Main.vb is a different
class not having any buttons anymore, therefore the error.
Now I could manually also put the whole "Partial Class" into the
"Forms" namespace, but as the file is "designer generated" I can
not touch it (or take the risk that my lines will be overwritten).
So, how do I move a Form into a namespace in VB 2005? This was no
problem in VB 2003 because it was all one file.
Armin
Just change it and make your default namespace the new namespace.
You should have a problem with it... At least, I haven't in c# :)
Uhm, sorry, but I don't understand. What should I change? The designer
generated file? Why should I have a problem with it? I don't want to change
the default namespace (you mean the root namespace of the project?), I only
want to put the Form in the Namespace.
Armin
In article <Oy**************@TK2MSFTNGP05.phx.gbl>, az*******@freenet.de
says...
Now I want to put the form into a namespace called "Forms". If I put the
lines "Namespace Forms" and "end namespace" before and after the code above,
I get an error at the "Handles" clause. Reason: The "Partial Class" in
Main.Designer.vb is still in the old Namespace. Consequently the class in
Main.vb is a different class not having any buttons anymore, therefore the
error.
Now I could manually also put the whole "Partial Class" into the "Forms"
namespace, but as the file is "designer generated" I can not touch it (or
take the risk that my lines will be overwritten).
I've done this before (in C#) and never had a problem with VS.NET
messing up my namespace declaration in the Main.Designer.cs file after
editing the form.
--
Patrick Steele http://weblogs.asp.net/psteele
You need to right click your solution and select view hidden files. Now you
can see and edit the designer files. The issue you are running up against
is that the VB IDE creates "default" namespaces.
Mike Ober.
"Patrick Steele" <pa*****@mvps.orgwrote in message
news:MP************************@msnews.microsoft.c om...
In article <Oy**************@TK2MSFTNGP05.phx.gbl>, az*******@freenet.de
says...
>Now I want to put the form into a namespace called "Forms". If I put the lines "Namespace Forms" and "end namespace" before and after the code above, I get an error at the "Handles" clause. Reason: The "Partial Class" in Main.Designer.vb is still in the old Namespace. Consequently the class in Main.vb is a different class not having any buttons anymore, therefore the error.
Now I could manually also put the whole "Partial Class" into the "Forms" namespace, but as the file is "designer generated" I can not touch it (or take the risk that my lines will be overwritten).
I've done this before (in C#) and never had a problem with VS.NET
messing up my namespace declaration in the Main.Designer.cs file after
editing the form.
--
Patrick Steele http://weblogs.asp.net/psteele
On 2007-02-11, Armin Zingler <az*******@freenet.dewrote:
"Tom Shelton" <to*********@comcastXXXXXXX.netschrieb
>On 2007-02-11, Armin Zingler <az*******@freenet.dewrote:
Hi all,
I have a Form called "Main":
Public Class Main
Private Sub Button1_Click( _
ByVal sender As System.Object, ByVal e As
System.EventArgs) _ Handles Button1.Click
End Sub
End Class
Now I want to put the form into a namespace called "Forms". If I
put the lines "Namespace Forms" and "end namespace" before and
after the code above, I get an error at the "Handles" clause.
Reason: The "Partial Class" in Main.Designer.vb is still in the
old Namespace. Consequently the class in Main.vb is a different
class not having any buttons anymore, therefore the error.
Now I could manually also put the whole "Partial Class" into the
"Forms" namespace, but as the file is "designer generated" I can
not touch it (or take the risk that my lines will be overwritten).
So, how do I move a Form into a namespace in VB 2005? This was no
problem in VB 2003 because it was all one file.
Armin
Just change it and make your default namespace the new namespace. You should have a problem with it... At least, I haven't in c# :)
Uhm, sorry, but I don't understand. What should I change? The designer
generated file?
Yes. Just change the namespace declaration in the designer file.
Why should I have a problem with it?
I meant you should not have a problem. It was a typo.
I don't want to change
the default namespace (you mean the root namespace of the project?), I only
want to put the Form in the Namespace.
I see, you already changed it and you are moving the form into it... Then just
change the designer file. It shouldn't cause any issues.
--
Tom Shelton
"Tom Shelton" <to*********@comcastXXXXXXX.netschrieb
Just change it and make your default namespace the new
namespace. You should have a problem with it... At least, I
haven't in c# :)
Uhm, sorry, but I don't understand. What should I change? The
designer generated file?
Yes. Just change the namespace declaration in the designer file.
Why should I have a problem with it?
I meant you should not have a problem. It was a typo.
Ah, I see.
>I don't want to change the default namespace (you mean the root namespace of the project?), I only want to put the Form in the Namespace.
I see, you already changed it and you are moving the form into it... Then
just
change the designer file. It shouldn't cause any issues.
Ok, I'll try.
Thanks Tom.
Armin
"Patrick Steele" <pa*****@mvps.orgschrieb
In article <Oy**************@TK2MSFTNGP05.phx.gbl>, az*******@freenet.de says...
Now I want to put the form into a namespace called "Forms". If I
put the lines "Namespace Forms" and "end namespace" before and
after the code above, I get an error at the "Handles" clause.
Reason: The "Partial Class" in Main.Designer.vb is still in the
old Namespace. Consequently the class in Main.vb is a different
class not having any buttons anymore, therefore the error.
Now I could manually also put the whole "Partial Class" into the
"Forms" namespace, but as the file is "designer generated" I can
not touch it (or take the risk that my lines will be overwritten).
I've done this before (in C#) and never had a problem with VS.NET
messing up my namespace declaration in the Main.Designer.cs file
after editing the form.
Ok, seems to be save. I'll try it.
Thanks Patrick.
Armin This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: SSRoy |
last post by:
Hi all,
The type library is an important file for COM interop, without which
unmanaged code can't interact with managed code.
When I use .NET 2003, I can sucessfully generate .tlb file from a .NET...
|
by: RA |
last post by:
Hi
I wonder if anyone tried this or know if it has been fixed.
I am using vs .net 1.1 and have a windows form.
In the form I have a DataGrid with the following format:
3 first Columns are of...
|
by: Sumit Gupta |
last post by:
Hi Can any one tell me how to move a form without titlebar as we can use WIn
API in VB 6.0 is there any other method or xyz for the same
Sumit
|
by: Ryan |
last post by:
I have 2 forms, Form1.vb and Form2.vb.
In Solution Explorer, Form2.vb no longer shows a Form icon nor do I have the
option to open Form2.vb in the main explorer window where usually I
have the...
|
by: Antro |
last post by:
Hi, i'm using visual C# 2005. I've got two forms, frmMain and frmCalendar. At the minute i am opening frmCalendar which ive created in the visual studio like this,
frmCalendar fmCalendar = new...
|
by: =?Utf-8?B?Unlhbg==?= |
last post by:
I have three forms in my application; frmMain being the main form:
frmMain containing two button; btnDisplayForm1 and btnDisplayForm2
FormA containing a button btnProcessRequestA
FormB containing...
|
by: =?Utf-8?B?Umlja1NlYW4=?= |
last post by:
I have a form with many text boxes; how do I implement Tool Tip for all text
boxes withour using MouseHover method for each individual textbox?
|
by: Hillbilly |
last post by:
Right now I have a shitload of form data in an event handler I will need
to reuse in other event handlers in the same page. Using firstName1 and
firstName2 for strings can't possibly be the way I...
|
by: peridian |
last post by:
Hi,
Apparently, even if you set the database type to 2000, when you create a database in 2005, it is marked as 2005 regardless, and you cannot then mount the files on a 2000 installation.
This...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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,...
|
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...
| |