ListView object model

J

JGPatrick

First, I would like to point out that, as far as I can tell, Microsoft's
documentation on the page
http://msdn.microsoft.com/en-us/library/aa733652(VS.60).aspx is incorrect, at
least for the ListView activeX control in VB 6.0 SP6. The documentation on
that page refers to the

ListView1.ListItems

collection. But if I try that in code, I get an error. ListItems turns out
to be a collection of the Object property, as in

ListView1.Object.ListItems

My questions:

1. Where do you find the object models for ActiveX controls? It is not on
the MSDN documentation page for the ListView control.

2. Where should I look for the help files on ActiveX controls? When I
double-click the control on my form, and then click the help button, I get an
error message saying that the file is not found. I try searching for the file
name on my computer, but it is not there.

3. Why does IntelliSense not show all available collections for the ListView
control?
IntelliSense does not list anything if you type Me dot lvwName dot Object dot
(where lvwName is the control's name property). However, if I then complete
the expression and make it Me.lvwName.Object.ListItems, I have no trouble
accessing the ListItems collection in my code.
 
T

Tom van Stiphout

On Sat, 16 Jan 2010 13:00:01 -0800, JGPatrick

You posted your questions in a forum about DAO and VBA programming in
Microsoft Access database application. You may have more luck in a
forum about VB6. Isn't that the 11-year old programming system that
has long since been superseded by VB.NET?

I typically set a reference to the particular ActiveX control, then
use the Object Browser to peruse its object model.
There are also Visual Studio 6 Tools that can show you what's exposed
in an ActiveX control.

-Tom.
Microsoft Access MVP
 
J

JGPatrick

Thanks, Tom, for your reply.

I think that's a great suggestion in general. In this case, unfortunately,
the Object Browser has the incorrect object model.

The reason this is an Access/VBA question is that I am trying to use VBA to
populate a ListView control on an Access form. (The only way to do this
is with VBA.) Apparently, the ListView activeX control referenced by the
Access ActiveX listbox has an object model that has been slightly altered
from the original control.

The reason I'm using a VB6 control rather than a VB.Net control is that this
is the choice you get in the Access ActiveX listbox.
 
A

Alex Dybenko

Hi,
- as Tom wrote - Object browser shows all objects/properties/methods
- old help files are not longer works on modern OSs (don’t ask we why)
- to make IntelliSense working you can declare a new variable of ListView
type, set it to ListView1.Object in form's load event and use it instead of
ListView1.Object

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top