Solved

Adding form to a VB.NET solution

Posted on 2014-07-29
3
638 Views
Last Modified: 2014-07-30
I am converting/rewriting a VB6 application into VB.NET.
I have re-written three (3) forms and independently they work the way I want them to.
I now want to make them into one (1) solution.
I added the first form (frmMain) and it works.
I added the second form (frmCustomerEdit) and it works
I went to add the third form (frmBOMSetup) and get an error.
The third file (frmBOMSetup) is using the VB6 DirListBox, DriveListBox and FileListBox
(I am including the three (3) files in the same subdirectory, .Designer.vb, .resx, .vb at the other two (2) forms)
When I just import, no errors, when go to open it, I get the following error.

The designer cannot process the code at line 47: Me.DriveListBox1 = New Microsoft.VisualBasic.Compatibility.VB6.DriveListBox() The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified. Please remove any changes and try opening the designer again

In the .Designer.vb, If I rem out line 47 then it moves to line 46, etc
Line 48 is the start of the DriveListBox, DirListBox, FileList Initial componrt

Any idea how to bring this into the project without re-writing it again?

thanks,
0
Comment
Question by:Adam_930
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 40227382
Rewriting is the way to go if you do not want to spend the next year solving problems such as that one. Except for very simple applications, it often ends up taking less time rewriting the application than converting and trying to make it work. It also gives you results that will be easier to maintain in the long run.

Some of the controls in VB6 do not work well in .NET. Try to learn to use the .NET controls instead. Not only will you get less problems, but they usually give you a lot more information and are more interesting for the user because they offer more functionality. And let's say it, applications that use the old VB6 controls look like Windows 3.1 applications.

The FolderBowser is a lot more interesting than the DriveListBox.

And the FileOpenDialog or FileSaveDialog are a very good replacement for the combination of the 3 controls that you were using in VB6. You will find them in the Dialog tab of the Toolbox.
0
 

Author Comment

by:Adam_930
ID: 40227510
James,
I am actually looking to have the user point to location of a file the application Open/Closes
 am storing the folder location and my application opens/edits/saves the file
How do I just point to a file name?
0
 
LVL 40

Assisted Solution

by:Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger) earned 500 total points
ID: 40227819
You fill a ComboBox with the filenames:

            For Each file As IO.FileInfo In New IO.DirectoryInfo("YourLocationDirectory").GetFiles()
                  ComboBox1.Items.Add(file.Name)
            Next

If you want, you can even add a search pattern so that only the files you created are listed:

            For Each file As IO.FileInfo In New IO.DirectoryInfo("YourLocationDirectory").GetFiles("*.txt")
                  ComboBox1.Items.Add(file.Name)
            Next
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question