Solved

Adding form to a VB.NET solution

Posted on 2014-07-29
3
624 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
  • 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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 connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

705 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now