Click here to Skip to main content
13,150,385 members (29,964 online)
Rate this:
Please Sign up or sign in to vote.
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

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:
Private Sub frmAPNote_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
End Sub
Posted 19-Jun-12 18:51pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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:

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170924.2 | Last Updated 20 Jun 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100