473,385 Members | 1,337 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,385 software developers and data experts.

assigning a listview control to a listview object

Hi all-

I am using a listview (MSComctlLib.ListViewCtrl.2)on an Access form.
Actually there are six listviews on the form. I need to do the same
thing to all six forms so I have the loop below. I would like to assign
each control to a listview object, however I get a type mismatch.
Further investigation reveals that the type of the control is "Custom
Control" and not a listview. I would like to be able to work with real
control object's intellisense for one thing. Why isn't the object
recognized for what it is?

Further, where can I get good documentation on what the listview is
good for and its API. I looked on the MS site and found what i think is
old documentation. For instance, it talks about a DragMode property,
but I can only find an OLEDragMode.

dim lsv as object
'dim lsv as MSComctlLib.ListView 'doesn't work

For x = 1 To 6
Set lsv = Me.Controls("lst" & x)

'Turns out this is a custom form
MsgBox TypeName(Me.Controls("lst" & x))

lsv.LabelEdit = 1
lsv.View = 3 ' Set View property to 'Report'.
lsv.HoverSelection = False
' lsv.DragMode = 0
lsv.OLEDragMode = ccOLEDragManual
lsv.ListItems.Clear
next x

Thanks,
Elie

Nov 13 '05 #1
1 5915
Try this. Open the form in design mode. On the menu bar select
Insert/ActiveX Control. Scroll to the ListView Control and double-click it.
While the new control still has the focus, delete it. See if it now works.
If it does not, wait for someone else to respond who has actually used a
Listview Control.

Mike Gramelspacher

"Welie" <we******@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hi all-

I am using a listview (MSComctlLib.ListViewCtrl.2)on an Access form.
Actually there are six listviews on the form. I need to do the same
thing to all six forms so I have the loop below. I would like to assign
each control to a listview object, however I get a type mismatch.
Further investigation reveals that the type of the control is "Custom
Control" and not a listview. I would like to be able to work with real
control object's intellisense for one thing. Why isn't the object
recognized for what it is?

Further, where can I get good documentation on what the listview is
good for and its API. I looked on the MS site and found what i think is
old documentation. For instance, it talks about a DragMode property,
but I can only find an OLEDragMode.

dim lsv as object
'dim lsv as MSComctlLib.ListView 'doesn't work

For x = 1 To 6
Set lsv = Me.Controls("lst" & x)

'Turns out this is a custom form
MsgBox TypeName(Me.Controls("lst" & x))

lsv.LabelEdit = 1
lsv.View = 3 ' Set View property to 'Report'.
lsv.HoverSelection = False
' lsv.DragMode = 0
lsv.OLEDragMode = ccOLEDragManual
lsv.ListItems.Clear
next x

Thanks,
Elie

Nov 13 '05 #2

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

Similar topics

0
by: Mike Barrett | last post by:
I have a strange one here and I believe it is a bug. I googled it and saw others having a similar issue and nobody seems to have a fix. I will take another shot. I get this ERROR MESSAGE... ...
0
by: willow1480 | last post by:
I am developing a small little Service Control Application. I am using a listview control with checkboxes and getting the list of services I want to control from a text file. When you check a...
0
by: PeacError | last post by:
Using Microsoft Visual Studio .NET 2003, Visual C# .NET 1.1: I apologize if this question has been addressed elsewhere, but I could not find a reference to it in the search engine for this...
0
by: Mike Barrett | last post by:
I have a strange one here and I believe it is a bug. I googled it and saw others having a similar issue and nobody seems to have a fix. I will take another shot. I get this ERROR MESSAGE... ...
7
by: BobAchgill | last post by:
I am trying to decide which of these controls to use to implement letting my user select a full row from MyList. The MyList has several columns which would be nice to sort by at run time. The...
6
by: Jack | last post by:
Hello, I've noticed through searching this group's previous posts that one can get the item the mouse is over in a listview control but I did not see how to get the subitem the mouse is over. Is...
5
by: Martin Horn | last post by:
Hi all, I want to implement a listview with editable subitems and I assume the easiest way is to overlay a textbox over the item to be edited. With this in mind I have come up with: Using...
12
by: garyusenet | last post by:
I have had no replies to my previous post so perhaps I didn't write it good enough. Please excuse new thread but i wanted to break from the last thread hopefully this thread will be better. ...
1
by: a | last post by:
Hi I would like to add some additional custom features to the listview, like cell editing. The created object will be added to the form as part of the GUI, and it should be able to handle...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.