A
Armin Zingler
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
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