Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old August 21st, 2003, 12:35 PM
emwatts emwatts is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: chicago
Posts: 12 emwatts User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question listview item selection problem

Good Afternoon, again.

Is there a way that I can select any item in my list other than the first? No matter which item I click, only the first item is in the selecteditem.text (example, I want abenddate information, I still only get jesnumber).

Set objItem = lstvwUnrsGrp.ListItems.Add(, _
"I" & rstAbends("Jesnumber"), rstAbends("Jobname"))
objItem.ListSubItems.Add , _
"Jes Number", rstAbends("Jesnumber")
objItem.ListSubItems.Add , _
"Abend Date", rstAbends("abenddate")


Private Sub lstvwUnrsGrp_ItemClick(ByVal Item As MSComctlLib.ListItem)

strabend_parm = lstvwUnrsGrp.SelectedItem.Text



Thanks.

Reply With Quote
  #2  
Old August 21st, 2003, 01:28 PM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 459 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 44 m 22 sec
Reputation Power: 8
when you use the item click event the item that is clicked is supplied as an argument. in your code above you'll see:
ByVal Item As MSComctlLib.ListItem

use that to get the contents of the clicked item. Item.Text is what appears in the first column. if that isn't what you want then you need to access the sub columns:
Code:
Private Sub lstvwUnrsGrp_ItemClick(ByVal Item As MSComctlLib.ListItem)
    strabend_parm = Item.SubItems(2)
End Sub

the index (2) is one based and index 1 is the first sub column.
__________________
Programmer's Corner

Reply With Quote
  #3  
Old August 21st, 2003, 02:18 PM
emwatts emwatts is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: chicago
Posts: 12 emwatts User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you so much. I'm getting tooooo much knowledge from this site!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > listview item selection problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway