Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.Net - Import "Embedded" Windows Form into Visual Studio

Status
Not open for further replies.

jmarkus

Technical User
Oct 15, 2002
124
0
0
CA
Hello,

I have a VB.net application within a single .vb file which contains windows form code which was modified manually (despite the 'It can be modified using the Windows Form Designer. Do not modify it using the code editor.' message).

I would like to somehow import this code into Visual Studio so that I can work with windows form designer to modify the form layout.

1. How can I get Visual Studio to recognize that I have a windows form in my .vb code?
2. Can the resulting code remain in the single .vb file or do I need to have a form.designer.vb code separate from the application code once I do so?

Thanks,
Jeff
 
Try this:

Create a project in Visual Studio. In the Solution Explorer (usually on the right side), right-click on the project name and select Add -> Existing Item... from the context menu. In the Add Existing Item dialog that pops up, navigate to the .vb file and select it, then click Add. You should now be able to modify the form.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Jebenson,

I tried your suggestion, but when I right click on my added .vb item in the solution explorer and pick "View Designer" all I see is a blank form - not the form that is defined in the added code.

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top