Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I recently have convert my project from VB6 to VB.NET2008,
after the convert here is a sub that control form from a module that i create,
the error was something like "cmdAdd is not a member of System.Windows.Forms.Form"
can somebody help??, thanks in advanced

VB
Public Sub ButtonSet(ByRef frmObj As System.Windows.Forms.Form)
	frmObj.cmdAdd.Visible = True
	frmObj.cmdCopy.Visible = True
	frmObj.cmdEdit.Visible = True
	frmObj.cmdCorrection.Visible = True
	frmObj.cmdDelete.Visible = True
	frmObj.cmdSave.Visible = True
	frmObj.cmdPrint.Visible = True
End Sub

how its call:
VB
Private Sub frmAPNote_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
	ButtonSet(Me)
End Sub
Posted

1 solution

There is a technology challenge on migrating VB6 to VB.NET application. In .NET Framework version 4.0 there are no equivalents so the code needs to be rewritten and controls need to be changed.

As an example, VB6 ListBox and ComboBox controls had the ItemData property. This was a companion list of long integers which could be used to store additional information related to an Item. For example, you could display a list of individuals in a ListBox and keep their age in the ItemData property:

VB
Dim Pos As Integer

Pos = List1.AddItem("Sneezy")
List1.ItemData(Pos) = 44
Pos = List1.AddItem("Grumpy")
List1.ItemData(Pos) = 56
Pos = List1.AddItem("Dopey")
List1.ItemData(Pos) = 22

The .NET ListBox class no longer contains an ItemData property. However, it is no longer necessary since the ListBox class in .NET gives us a more power and control for maintaining the items.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900