-
Aug 31st, 2014, 01:47 PM
#1
Thread Starter
Fanatic Member
Controlling if the application is in one or two files
Does any one know how to specify if you want to build your VB project with all the code for the form and logic in one file (i.e., the Designer file), or have the form design in the Designer file and the logic in the vb file?
-
Aug 31st, 2014, 06:42 PM
#2
Re: Controlling if the application is in one or two files
-
Aug 31st, 2014, 06:46 PM
#3
Thread Starter
Fanatic Member
Re: Controlling if the application is in one or two files
No. At least I don't think so. A student submitted a file with the content that normally is in the code file at the end of the Design file. So I have:
form1.vb is blank
form1.designer.vb has the details on the form objects and all the class code.
I want to figure out what the student did so I can tell them what not to do.
-
Aug 31st, 2014, 06:49 PM
#4
Re: Controlling if the application is in one or two files
Yes, a partial class. The student likely deleted their .vb file or at least deleted the Form definition, and then double-clicked a control, which would bring up the code file, which is missing, so at a guess reverts to the designer file.
-
Aug 31st, 2014, 08:14 PM
#5
Thread Starter
Fanatic Member
Re: Controlling if the application is in one or two files
I thought I read a while back that there was some option of having everything in a single file or with two files. I may be thinking of ASP.net, but I thought it was VB.
-
Aug 31st, 2014, 08:50 PM
#6
Re: Controlling if the application is in one or two files
Originally Posted by John_SC
No. At least I don't think so. A student submitted a file with the content that normally is in the code file at the end of the Design file. So I have:
form1.vb is blank
form1.designer.vb has the details on the form objects and all the class code.
I want to figure out what the student did so I can tell them what not to do.
Since this was a student, I have to ask if they found an old VS 2003 project online an did an upgrade that would have retained that structure.
-
Aug 31st, 2014, 09:41 PM
#7
Re: Controlling if the application is in one or two files
Originally Posted by TnTinMN
Since this was a student, I have to ask if they found an old VS 2003 project online an did an upgrade that would have retained that structure.
This is probably the most likely explanation. VB.NET 2003 and earlier used a single file - partial classes didn't exist - while VB 2005 and later use separate designer and user code files. Those separate files are just convention though. The IDE will use one or the other by default, depending on the circumstances but they both contain a partial class definition so you can put whatever code you want in either. There is no way that I've ever seen to tell VB 2005 or later to use a single code file by default.
-
Aug 31st, 2014, 10:55 PM
#8
Thread Starter
Fanatic Member
Re: Controlling if the application is in one or two files
I will see the student on Wednesday and try to figure out what happened. I doubt they found a VB2003 version of the program, but that would have been much more work than I asked the students to do. Thanks for everyone's input. I will post something back once I figure out what happened.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|