Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET Forms Modules
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
 
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
	ButtonSet(Me)
End Sub
Posted 19-Jun-12 19:51pm

1 solution

Rate this: bad
good
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.
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 8,284
1 Sergey Alexandrovich Kryukov 7,327
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,920


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 20 Jun 2012
Copyright © CodeProject, 1999-2014
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