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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upgrading older VB programs (sans Project Files) to VB.NET

Status
Not open for further replies.

weberm

Programmer
Dec 23, 2002
240
US
I have some old Visual Basic programs I'd like to upgrade to .NET because they currently require obsolete drivers like "VBRUN300.DLL" to run. I attempted to use the upgrade wizard but it appears it requires a project file and I only have .FRM, .FRX, and Make files, like this one:
Code:
VERSION 2.00
Begin Form Form1 
   BackColor       =   &H00C0C0C0&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Dice roller"
   ClientHeight    =   1950
   ClientLeft      =   1230
   ClientTop       =   2625
   ClientWidth     =   2295
   Height          =   2355
   Icon            =   SRDICE01.FRX:0000
   Left            =   1170
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   1950
   ScaleWidth      =   2295
   Top             =   2280
   Width           =   2415
   Begin TextBox Text3 
      BackColor       =   &H00000000&
      ForeColor       =   &H00FFFFFF&
      Height          =   285
      Left            =   1200
      TabIndex        =   7
      Text            =   "0"
      Top             =   1560
      Width           =   975
   End
   Begin TextBox Text2 
      Height          =   285
      Left            =   1560
      TabIndex        =   2
      Text            =   "4"
      Top             =   480
      Width           =   615
   End
   Begin ListBox List1 
      Columns         =   3
      Height          =   1005
      Left            =   120
      Sorted          =   -1  'True
      TabIndex        =   4
      Top             =   840
      Width           =   975
   End
   Begin CommandButton Command1 
      BackColor       =   &H00C0C0C0&
      Caption         =   "&Roll"
      Default         =   -1  'True
      Height          =   375
      Left            =   1200
      TabIndex        =   3
      Top             =   840
      Width           =   975
   End
   Begin TextBox Text1 
      Height          =   285
      Left            =   1560
      TabIndex        =   1
      Text            =   "1"
      Top             =   120
      Width           =   615
   End
   Begin Label Label1 
      BackColor       =   &H00C0C0C0&
      Caption         =   "Successes"
      Height          =   255
      Index           =   2
      Left            =   1200
      TabIndex        =   6
      Top             =   1320
      Width           =   975
   End
   Begin Label Label1 
      BackColor       =   &H00C0C0C0&
      Caption         =   "&Target number"
      Height          =   255
      Index           =   1
      Left            =   120
      TabIndex        =   5
      Top             =   480
      Width           =   1335
   End
   Begin Label Label1 
      BackColor       =   &H00C0C0C0&
      Caption         =   "&Number of dice"
      Height          =   255
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   1335
   End
End

Sub Command1_Click ()

  list1.Clear
  nsucc = 0
  For i = 1 To Val(text1.Text)
    v = 0
reloop:
    v = v + Int(Rnd(6) * 6 + 1)
    If v Mod 6 = 0 Then GoTo reloop
    If v >= Val(text2.Text) Then nsucc = nsucc + 1
    list1.AddItem Format$(v, "00")
    Next
  text3.Text = Format$(nsucc)

End Sub
I have a feeling these pre-date VB 6 but wondered if there is a way to systematically perform the upgrade without a project file instead of making them from scratch.
 
Your script is a description of the project, not actually a project.

The begin part describes the controls on the form but is not code.

If open a new vb6 project with a blank form you can place the labels, list box and command button controls as described.

Then paste your subroutine parts of the your code to the form1 code
Test it

Save your new project and convert this to vbnet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top