Re: Windows form designer generated code being misplaced



On Sat, 26 Jan 2008 20:49:15 -0800 (PST), BobRoyAce
<broy@xxxxxxxxxxxxxxxxxxxx> wrote:

In the cases where there is no Designer.vb file associated with the
form, how do I go about creating the corresponding Designer.vb file?
Do I just add a new class file to the same folder where the form files
are and name it Form.Designer.vb, where Form is the name of the form?
Then, I just grab the windows-generated code from Form.vb and put it
in there (with the needed Partial Class declaration at the beginning)?

I also have never had this happen with projects created in VS2005.

However, if you have such a file and want to add a designer.vb file,
this is how to do it:

Create the xx.designer.vb file.
Add the xx.designer.vb file to the project with Project -> Add
Existing Item.
Close the project.
Make a copy of the .vbproj file in case something goes wrong.
Edit the .vbproj file in a text editor like Notepad. Find the lines
describing the xx.designer.vb file. It should look something like:
<Compile Include="ctlEditbox.Designer.vb" />
Expand the <Compile /> clause to have an ending tag and add a
DependentUpon clause:
<Compile Include="ctlEditbox.Designer.vb">
<DependentUpon>ctlEditbox.vb</DependentUpon>
</Compile>
.



Relevant Pages

  • Re: someone please help me with this.....
    ... Wow....saving any VB class file in the 'App_Code' directory doesn't ... You seem to have everything in the wwwroot folder. ... have any DLL named 'LoginUserFetchDB.dll'. ... Delete the /bin folder after confirming it will compile and continue your development work. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Classes outside App_Code folder in website application (VS2008)
    ... need to place the class file in the same folder as the page that uses it, ... For the same reason, converting to a Web ... would like to keep it in a separate file so I can reference it from several ...
    (microsoft.public.dotnet.general)
  • Re: format all .cs files in the project using visual studio 2005
    ... when you create a new class file, ... remember the folder for VS 2005 off hand, but I used to do it with every new ... Gregory A. Beamer ...
    (microsoft.public.dotnet.framework)
  • RE: Confusion about Namespaces and App_Code, etc. in VS2008/ASP.net3.5
    ... In a Web Application project the App_Code folder is just like a normal ... drag the class file to the ... In this way the IDE will compile the class file. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • Java Newbie - import cs1.Keyboard;
    ... I am learning Java and just encountered something strange... ... When I run my .class file from a directory outside the one that contains ... However if I run this from the directory which contains the folder ... java compiler is importing this class file into the program when it ...
    (SecProg)