473,395 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Upgrading VB 6 to VB.NET

13
Hi, im currently doing an upgrade from vb6 to vb.net with the help of code advisor. Im also new to vb.net.

However, im still facing some problems modifying existing codes to perform the conversion. Below is the message showing that I need to modify the codes.

'FIXIT: 'lstItem.ForeColor' is not a property of the generic 'Form' object in Visual Basic .NET. To access 'lstItem.ForeColor' declare 'obj' using its actual type instead of 'Form' FixIT90210ae-R1460-RCFE85
obj.lstItem.ForeColor = &HFF& 'red

The problem here is how do i modify it?...I really dont have any idea on how to do that.

Actually I have also read through the msdn but it didnt do any help as the example given is the issue :

'Value' is not a property of the generic 'Control' object in vb.net. To access 'Value' declare 'ctl' using its actual type instead of 'Control'..... Please help me.

Many thanks.
Feb 26 '07 #1
14 4192
willakawill
1,646 1GB
Hi. Who wrote the code that you are trying to update to .NET?
Why are you updating this particular code to .NET?
Feb 26 '07 #2
vijaydiwakar
579 512MB
Hi, im currently doing an upgrade from vb6 to vb.net with the help of code advisor. Im also new to vb.net.

However, im still facing some problems modifying existing codes to perform the conversion. Below is the message showing that I need to modify the codes.

'FIXIT: 'lstItem.ForeColor' is not a property of the generic 'Form' object in Visual Basic .NET. To access 'lstItem.ForeColor' declare 'obj' using its actual type instead of 'Form' FixIT90210ae-R1460-RCFE85
obj.lstItem.ForeColor = &HFF& 'red

The problem here is how do i modify it?...I really dont have any idea on how to do that.

Actually I have also read through the msdn but it didnt do any help as the example given is the issue :

'Value' is not a property of the generic 'Control' object in vb.net. To access 'Value' declare 'ctl' using its actual type instead of 'Control'..... Please help me.

Many thanks.
are u using listbox ctrl in vb? then trying to convert it into .net?
u can also convert the code from vb to .net by directly opening the vb project from vb.net2005 edition
Feb 26 '07 #3
foocc
13
are u using listbox ctrl in vb? then trying to convert it into .net?
u can also convert the code from vb to .net by directly opening the vb project from vb.net2005 edition
Hi. Yes, the existing system in vb6 is using listbox ctrl and im now trying to convert it to vb.net.

Ive tried your way by opening it directly from vb.net 2005 and i got this :

'FIXIT: 'lstItem.ForeColor' is not a property of the generic 'Form' object in Visual Basic .NET. To access 'lstItem.ForeColor' declare 'obj' using its actual type instead of 'Form' FixIT90210ae-R1460-RCFE85
'UPGRADE_ISSUE: Control lstItem could not be resolved because it was within the generic namespace Form.
obj.lstItem.ForeColor = &HFF 'red

What should i do now? Something seems to be not right for the code in bold. How do i modify it?

Seriously, i have no experience in vb.net before with the fact that im only a new IT trainee and my boss asks me convert the system from vb 6 to vb.net.

Hope that u can help and guide me through this. Actually, what is the first step to do when i want to convert vb to vb.net? Do i need to modify any coding in vb 6?

Many thanks.
Feb 27 '07 #4
AricC
1,892 Expert 1GB
Hi. Yes, the existing system in vb6 is using listbox ctrl and im now trying to convert it to vb.net.

Ive tried your way by opening it directly from vb.net 2005 and i got this :

'FIXIT: 'lstItem.ForeColor' is not a property of the generic 'Form' object in Visual Basic .NET. To access 'lstItem.ForeColor' declare 'obj' using its actual type instead of 'Form' FixIT90210ae-R1460-RCFE85
'UPGRADE_ISSUE: Control lstItem could not be resolved because it was within the generic namespace Form.
obj.lstItem.ForeColor = &HFF 'red

What should i do now? Something seems to be not right for the code in bold. How do i modify it?

Seriously, i have no experience in vb.net before with the fact that im only a new IT trainee and my boss asks me convert the system from vb 6 to vb.net.

Hope that u can help and guide me through this. Actually, what is the first step to do when i want to convert vb to vb.net? Do i need to modify any coding in vb 6?

Many thanks.
Will this help?
Feb 27 '07 #5
Killer42
8,435 Expert 8TB
Is it possible that the code is simply referring to a control (lstItem) that no longer exists?
Feb 27 '07 #6
willakawill
1,646 1GB
Is it possible that the code is simply referring to a control (lstItem) that no longer exists?
I am much more interested that this question was ignored:
Hi. Who wrote the code that you are trying to update to .NET?
Why are you updating this particular code to .NET?
Feb 27 '07 #7
foocc
13
Hi. Sorry for not answering your question. Actually, im not sure who wrote the codes as im new to the company. And im not only trying to update that code. I have a other codes with similar error and I thought tht if i could solve 1 then i can solve the other problems as well.

Here's my other problems after using the upgrade wizard :

'FIXIT: Declare 'objForm' with an early-bound data type FixIT90210ae-R1672-R1B8ZE
Sub MenuControl(ByRef objForm As Object, ByRef V1 As Boolean, ByRef V2 As Boolean, ByRef V3 As Boolean, ByRef V4 As Boolean, ByRef V5 As Boolean, ByRef V6 As Boolean)
With objForm
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.mnuCreate. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.mnuCreate.Visible = V1
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.mnuChange. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.mnuChange.Visible = V2
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.mnuDelete. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.mnuDelete.Visible = V3
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.mnuSave. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.mnuSave.Visible = V4
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.mnuCancel. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.mnuCancel.Visible = V5
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.mnuPrint. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.mnuPrint.Visible = V6
End With
__________________________________________________ __________

'FIXIT: Declare 'objForm' with an early-bound data type FixIT90210ae-R1672-R1B8ZE
Sub ValidateInput(ByRef objForm As Object, ByRef TF As Boolean)
Dim target As String
TF = True
With objForm
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.txtCustCode. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If .txtCustCode.Text = "" Then
MsgBox("Please enter Customer Code")
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.txtCustCode. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.txtCustCode.SetFocus()
TF = False
Exit Sub
Else
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.lblcmdCustCode. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If .lblcmdCustCode.Caption = "" Then
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.txtCustCode. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call basDetail.GetCustName(.txtCustCode.Text, target)
'UPGRADE_WARNING: Couldn't resolve default property of object target. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If target = "Not Found in VB" Then
MsgBox("Error in Customer Code")
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.txtCustCode. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.txtCustCode.SetFocus()
TF = False
Exit Sub
Else
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.lblcmdCustCode. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
'UPGRADE_WARNING: Couldn't resolve default property of object target. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.lblcmdCustCode.Caption = target
End If
End If
End If

'UPGRADE_WARNING: Couldn't resolve default property of object objForm.txtEffective. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If .txtEffective.Text = "" Then
MsgBox("Please enter Effective Date")
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.txtEffective. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.txtEffective.SetFocus()
TF = False
Exit Sub
End If

'UPGRADE_WARNING: Couldn't resolve default property of object objForm.cboMaxQty. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If .cboMaxQty.Text = "" Then
MsgBox("Please enter Max Qty")
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.txtMaxQty. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.txtMaxQty.SetFocus()
TF = False
Exit Sub
End If

'UPGRADE_WARNING: Couldn't resolve default property of object objForm.cboVanQty. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If .cboVanQty.Text = "" Then
MsgBox("Please enter the No. of Vans to claim")
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.txtVanQty. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.txtVanQty.SetFocus()
TF = False
Exit Sub
Else
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.cboMaxQty. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.cboVanQty. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If .cboVanQty.Text > .cboMaxQty.Text Then
MsgBox("No. of Vans to claim must be =< Max. Qty")
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.txtVanQty. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.txtVanQty.SetFocus()
TF = False
Exit Sub
End If
End If

'UPGRADE_WARNING: Couldn't resolve default property of object objForm.txtNar3. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If .txtNar3.Text = "" Then
MsgBox("Please enter Vehicles No in Narration line 3")
'UPGRADE_WARNING: Couldn't resolve default property of object objForm.txtNar3. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.txtNar3.SetFocus()
TF = False
Exit Sub
End If

End With
End Sub
__________________________________________________ ______
How do i solve this?

Many thanks
Mar 1 '07 #8
Killer42
8,435 Expert 8TB
The "FIXIT" entries sound as though they might go away if you just declare objForm as type Form rather than the more generic Object. I'm not sure you need to do anything about the upgrade warnings.

(This is pure guesswork, though.)
Mar 1 '07 #9
willakawill
1,646 1GB
Hi. Sorry for not answering your question. Actually, im not sure who wrote the codes as im new to the company. And im not only trying to update that code. I have a other codes with similar error and I thought tht if i could solve 1 then i can solve the other problems as well.
Many thanks
Yes I had a hunch that this was not code you had written yourself. I still don't understand why you feel the need to 'update' the code to a different compiler.
Mar 1 '07 #10
Killer42
8,435 Expert 8TB
Yes I had a hunch that this was not code you had written yourself. I still don't understand why you feel the need to 'update' the code to a different compiler.
Yeah, go and tell your boss that willakawill says you don't need to do it. ;)

Don't worry, we've got a special forum where you can look for a new job.
Mar 1 '07 #11
foocc
13
Yes I had a hunch that this was not code you had written yourself. I still don't understand why you feel the need to 'update' the code to a different compiler.
Hi. Really? There's a forum to look for new jobs? However, this is actually my internship program, so unfortunately i have to go on, whether there is actually the need to upgrade the system or not.

So, i could really use a little more help here.

Ive got this warning :Variable 'drRate' is used before it has been assigned a value. A null reference exception could result at runtime.

What exactly is the problem here?....and how do i solve it?

Expand|Select|Wrap|Line Numbers
  1. Public Sub mnuStdRateList_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles mnuStdRateList.Click
  2.     Dim drRate As Object
  3.     Dim drVRate As Object
  4.     Dim strTitle As Object
  5.     'UPGRADE_WARNING: Couldn't resolve default property of object strTitle. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
  6.     strTitle = "List of Standard Rate as at " & Now
  7.     'UPGRADE_WARNING: Couldn't resolve default property of object drVRate.Title. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
  8.     'UPGRADE_WARNING: Couldn't resolve default property of object strTitle. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
  9.     drVRate.Title = strTitle
  10.     deWVA.rscmdVRate.Properties.Refresh()
  11.     'UPGRADE_WARNING: Couldn't resolve default property of object drRate.Show. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
  12.     drRate.Show(1)
  13. End Sub
Many thanks.
Mar 1 '07 #12
Killer42
8,435 Expert 8TB
Not familiar with this stuff myself, but doesn't it seem slightly unusual that you are creating an object (drRate), then "showing" it, without setting any properties or anything?
Mar 1 '07 #13
willakawill
1,646 1GB
Yeah, go and tell your boss that willakawill says you don't need to do it. ;)

Don't worry, we've got a special forum where you can look for a new job.
Better still. Tell your boss that your best approach is to go on the internet and take advice from pundits who have never used .net

Gold star instantly :)
Mar 1 '07 #14
Killer42
8,435 Expert 8TB
Better still. Tell your boss that your best approach is to go on the internet and take advice from pundits who have never used .net
Excellent idea. :D

On a slightly more serious note foocc, have you asked about this in the .Net forum? It seems likely there would be a fair bit of experience in VB upgrades to .Net over there.
Mar 1 '07 #15

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: S. Crespel | last post by:
Hi, Where can I find informations about consequences of upgrading from PHP 4.2.3 to 4.3 regarding existing PHP applications ? I have lots of existing PHP (4.2.3) scripts, will everything still...
1
by: bartolomesintes | last post by:
Hi, I have installed PHPHome 2.3.4 in Windows XP. This WAMP package installs Apache 2.0.50 , PHP 5.0.0 and it works fine. The SQLite installed version is 2.8.14 and I would like to upgrade to a...
6
by: Michael Foord | last post by:
http://www.voidspace.org.uk/python/articles/upgrading_python.html I've been looking at whether to upgrade immediately from Python 2.3 to Python 2.4 or postpone it. This is my first `major version...
0
by: Jonathan Hilgeman | last post by:
Currently, I'm running 3.23.51 on Red Hat 7.1, and I'm contemplating upgrading to MySQL 4.0, but I'm not sure what to expect. I don't know if MySQL 4.0 is fully backwards-compatible with 3.23.x...
2
by: wellington fan | last post by:
Dear newsies, My ISP has offered to upgrade my servers from 3.23 to 4.1. I'm excited by the potential gains in performance, and the ability to write subqueries, but am wary of any forward...
5
by: Mike Owen | last post by:
Hi, I have just used the import Wizard to import a VS 2003 app to VS 2005. I have a lot of work to do to enable it to compile successfully with all the errors and warnings it gave me, but as a...
13
by: Noesis Strategy | last post by:
When I ordered my new laptop, Sony didn't offer Access 2003 in its bundles. Recently, I have begun to design Access databases using an copy of Access 2002 from my previous laptop. It works fine,...
11
by: Aidan Tobin | last post by:
Hi, I have to upgrade a number of databases from Access 2.0, Access 97 and Access 2000 to work in Office 2003. These databases contain a number of Forms coded with VBA as well as a number of...
1
by: progTiger | last post by:
The upgrade wizard just hangs on step 5 of 5 when it reaches "Upgrading DataEnvironment..." I have let it sit for 3 hours and it does nothing. .Net Studio is not frozen, but the process does...
6
by: JimLad | last post by:
Hi, We have a major ASP app that we are in the process of upgrading to ASP.NET 1.1 and probably on to ASP.NET 2.0 in the middle of next year. (We will also be upgrading to SQL2K5 at the same...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.