473,657 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to convert code snipped from VB6 to Visual Studio 2005/VB (VB7?)

I found some sample VB code which I'm trying to implement in Visual
Studio 2005. I think the code was VB6. VS05 doesn't like the syntax.
I've distilled things down to the part with the error:

Public Sub WontRun(ByVal v As ListView)
Dim x As ListItem
x = v.ListItems.Add (, , "c:\test\file.t xt")
End Sub
Error 1 'ListItems' is not a member of
'System.Windows .Forms.ListView '.
Does anybody know what the correct code would be for this under Visual
Studio 2005/VB?

Oct 4 '06 #1
5 2016
bro your code doesn't make any sense to me.. what are you trying to do ?

Oct 4 '06 #2
I made a subset of the actual code. This is part of a subroutine which
adds filepath/filename data to a ListView...

aa*********@gma il.com wrote:
bro your code doesn't make any sense to me.. what are you trying to do ?
Oct 4 '06 #3
On 3 Oct 2006 17:48:59 -0700, "vb newbie" <te************ **************@ xoxy.net>
wrote:
>I found some sample VB code which I'm trying to implement in Visual
Studio 2005. I think the code was VB6. VS05 doesn't like the syntax.
I've distilled things down to the part with the error:

Public Sub WontRun(ByVal v As ListView)
Dim x As ListItem
x = v.ListItems.Add (, , "c:\test\file.t xt")
End Sub
Error 1 'ListItems' is not a member of
'System.Window s.Forms.ListVie w'.
Does anybody know what the correct code would be for this under Visual
Studio 2005/VB?
The syntax for ListView in VS05 is somewhat different than in VB6.

This is a very elementry question. The answer can easily be found in the Help file,
with simple example. Lookup ListView Control, adding list iems, and, adding
ListSubItems.

Gene
Oct 4 '06 #4
Assuming "v" is a listview control:

Dim x as ListViewItem
x = v.Items.Add(, , "c:\test\file.t ext")

Thanks,

Seth Rowe

vb newbie wrote:
I found some sample VB code which I'm trying to implement in Visual
Studio 2005. I think the code was VB6. VS05 doesn't like the syntax.
I've distilled things down to the part with the error:

Public Sub WontRun(ByVal v As ListView)
Dim x As ListItem
x = v.ListItems.Add (, , "c:\test\file.t xt")
End Sub
Error 1 'ListItems' is not a member of
'System.Windows .Forms.ListView '.
Does anybody know what the correct code would be for this under Visual
Studio 2005/VB?
Oct 4 '06 #5
Have you tried the VB 6 converter in VS 2005? It handles short code
segments really well. Just don't use it for entire projects as it will make
a mess of the converted code.

Mike Ober.

"vb newbie" <te************ **************@ xoxy.netwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
I found some sample VB code which I'm trying to implement in Visual
Studio 2005. I think the code was VB6. VS05 doesn't like the syntax.
I've distilled things down to the part with the error:

Public Sub WontRun(ByVal v As ListView)
Dim x As ListItem
x = v.ListItems.Add (, , "c:\test\file.t xt")
End Sub
Error 1 'ListItems' is not a member of
'System.Windows .Forms.ListView '.
Does anybody know what the correct code would be for this under Visual
Studio 2005/VB?


Oct 4 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1463
by: patrick lynch | last post by:
Good morning, I'm reading "Programming Microsoft Windows with Microsoft Visual Basic .NET" by Charles Petzold. I have Visual Studio installed but it is now expired (as an aside, I can not remove it, bummer). I seem to be in a "Catch-22" situation...the book states the following: "...if you're running Visual Basic .NET as opposed to Visual Studio. NET, you'll need to add two
8
4021
by: Stephen | last post by:
Hi, has anyone converted code from VS 2005 to VS 2003? Thanks, Stephen
1
1694
by: Parasyke | last post by:
Thanks in advance. I'm new to XML. I need to convert an existing Access table into XML which will allow me on a form to read the table into XML, edit, then reconvert it back to the Access table. I have successfully added the Northwind database to my data sources in Visual Studio 2003 (Standard Edition). I also have the following code which reads from an EXISTING XML file not related to the Access file. How could I alter it to pull from...
0
1277
by: alto | last post by:
After compeleting steps 1 to 5 of the Step-By-Step Guide to Converting Web Projects from Visual Studio .NET 2002/2003 to Visual Studio 2005 (http://msdn.microsoft.com/asp.net/reference/migration/upgrade/default.aspx?pull=/library/en-us/dnaspp/html/webprojectsvs05.asp#wapp_topic13) I am stuck at step 6: Covert Code-Behind Classes to Partial Classes. In Solution Explorer I right-click the project name - Convert to Web Application option is...
1
1675
by: David Lozzi | last post by:
Howdy, I've created an entire ecommerce site as a Web Site project (WSP) in VS2005. Now that i'm trying to publish it I'm finding that I should've used the ASP.Net Web Application (ANWA) project instead. I created a new ANWA and imported all of the pages from my WSP and I received a ton of errors. A lot of them had to do with imports of self contained classes. I had to add the project name to the import call, i.e. imports common to...
13
4368
by: jc | last post by:
I have written a parser using bison and flex to read ASAP2 file for CAN communications. entire development was done in an unix environment and now the code is ready to be integrated to an existing CAN communication software that i wrote earlier in windows environment(as we get drivers for these CAN cards only for the windows). my problem started when i started to move the code from linux to the visual studio. after many compilation and...
1
3591
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in some files and work on it. Let say, I want add new page to web project named websiteOrder.sln, i will open websiteOrder.sln in my local computer, connected to websiteOrder.sln located in Visual Source Safe 6.0(source safe located in another...
4
3380
by: wbsurfver | last post by:
We have classic ASP running (so I'm told) on IIS 6, and I found a vbc executable on the system that says visual basic 7 when I run vbc - help . If I have them install Visual Studio 2005, I am hoping it is backward compatible with our current ASP codebase ?
1
1600
by: lds | last post by:
I have Visual Studio 2005 Professional Edition installed with Service Pack 1. I have several solutions and projects that I have migrated from Visual Studio 2003 to 2005. In most cases the changes I had to make were small and when the web projects were converted it told me to select convert to web application, which I have done. This one application that I have migrated asks me to convert to a "web site project" every time I open the...
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1611
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.