renrutm
asked on
ListView Control Documentation
Hello All,
I have several questions but I am trying to find some solid documentation on VisualBasic(MS Access 2000) - specifically on the ListView & ListItems. I can't seem to find any good documentation and I think I have exhausted google. Anyway, I will ask the questions but I believe that they could all be answered if someone could give or point me to adequate documentation on the ListView & ListItem controls and since it is a seperate control there is no documentation in the help files.
1. How do you make the ListView row uneditable?
- Currently I have the fullrowselect set to true and it drops into edit mode on the first item in the row.
2. It doesn't seem to have an event for a doubleclick. Is there a way to change that?
3. Once an event is activated (i.e. listview1_enter()), how do you retrieve the values of the selected item?
4. Is there a way to make a column in the list view hidden(i.e. a key field - I want to show the data but not the key)?
I think that's all for now. Sorry for all the questions, I would be appreciative of any help. Thanks in advance.
Mike
I have several questions but I am trying to find some solid documentation on VisualBasic(MS Access 2000) - specifically on the ListView & ListItems. I can't seem to find any good documentation and I think I have exhausted google. Anyway, I will ask the questions but I believe that they could all be answered if someone could give or point me to adequate documentation on the ListView & ListItem controls and since it is a seperate control there is no documentation in the help files.
1. How do you make the ListView row uneditable?
- Currently I have the fullrowselect set to true and it drops into edit mode on the first item in the row.
2. It doesn't seem to have an event for a doubleclick. Is there a way to change that?
3. Once an event is activated (i.e. listview1_enter()), how do you retrieve the values of the selected item?
4. Is there a way to make a column in the list view hidden(i.e. a key field - I want to show the data but not the key)?
I think that's all for now. Sorry for all the questions, I would be appreciative of any help. Thanks in advance.
Mike
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
3. You are wrong. The first subitem is actually the second column. The first column is the ListView1.Text property.
This is how the other columns are set (providing the view is set to Report)
Dim li as ListItem
Set li = ListView1.ListItems.Add(,, "Text for first Column")
li.Subitems(1) = "Text for second column"
li.Subitems(2) = "Text for third column"
etc
So to read the values back, assuming you want to do so for the selected item, I would program it like this:
Set li = ListView1.SelectedItem
If Not li is Nothing Then'check that actually something is selected, otherwise you get a run time error
MsgBox "First Column = " & li.Text
MsgBox "Second Column = " & li.Subitems(1)
etc
This is how the other columns are set (providing the view is set to Report)
Dim li as ListItem
Set li = ListView1.ListItems.Add(,,
li.Subitems(1) = "Text for second column"
li.Subitems(2) = "Text for third column"
etc
So to read the values back, assuming you want to do so for the selected item, I would program it like this:
Set li = ListView1.SelectedItem
If Not li is Nothing Then'check that actually something is selected, otherwise you get a run time error
MsgBox "First Column = " & li.Text
MsgBox "Second Column = " & li.Subitems(1)
etc
As to documentation, have you tried highlighting a ListView and pressing F1 for help?
If you do get help for the ListView, then click on "See Also" and select "Using the ListView Control"
It has lots of examples and explanations
Dabas
If you do get help for the ListView, then click on "See Also" and select "Using the ListView Control"
It has lots of examples and explanations
Dabas
ASKER
Thanks Dabas,
I am using MS Access and It doesn't have any documentation(or I haven't found it) on any of the controls except those which are packaged with (i.e. Textbox, label...). I have already tried what you said(higlighting and pressing F1) and it comes back blank - no see also or anything. I wish I had the help files, if so, I wouldn't have run into these problems and I wouldn't have to bug you. I will try what you said with the subitems. Thanks again for you time and effort.
Mike
I am using MS Access and It doesn't have any documentation(or I haven't found it) on any of the controls except those which are packaged with (i.e. Textbox, label...). I have already tried what you said(higlighting and pressing F1) and it comes back blank - no see also or anything. I wish I had the help files, if so, I wouldn't have run into these problems and I wouldn't have to bug you. I will try what you said with the subitems. Thanks again for you time and effort.
Mike
Aaahhh... Now I understand!!!
Programming in Access is torture and I do not envy you!
Programming in Access is torture and I do not envy you!
ASKER
Thank you for a little of your expertise. I am using 6.0 SP4 just like you. Do you know where I can get documentation on the controls and their methods and properties? These are just a few of the problems I am running into. I have looked on the web and am only finding a little of the info I need.
1. Worked - Thanks.
2. I made a DblClick() Method and it worked.
3. Worked. Not that I need it to now, but how do you get to the other subitems of the list item? Right, now it only returns the first subitem(which happens to be the key). Thanks.
4. Works. Thanks.
3 and 4 I almost thought didn't work because I don't have documentation, so I didn't know how to do what you were saying, but I eventually figured it out. Thanks for all your help. If I can get more points I will ask more questions. Thanks again. This helps me out tremendously. If you know where to find good documentation, that would help out a lot too.
Mike