Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: VB.NET Forms Modules
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 19: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
0 Maciej Los 470
1 Sergey Alexandrovich Kryukov 424
2 OriginalGriff 360
3 Abhinav S 250
4 CHill60 240
0 Sergey Alexandrovich Kryukov 10,102
1 OriginalGriff 9,495
2 Peter Leow 5,241
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 3,076

Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 20 Jun 2012
Copyright © CodeProject, 1999-2015
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