Hi Again Jeff,
This is a list box in my Clipboard app where I move items up and down a
list. It also has 2 items for I break out paths and names so there is a sub
item in the list, or a second column.
So when you have moved up or down using the cursor in the list you will use
the focused method.
Sub MoveUpList()
'Move Up List View.
Dim text, text1, row
On Error Resume Next
row = LV_Control.Items.focused.Index
text = LV_Control.Items.focused.text
text1 = LV_Control.Items.focused.text(1)
If row > 1 Then
Silence
row = row - 2
Speak " Moving Up "
AddListItem LV_Obj, FileListName, row, text & text1
LV_Control.Items.focused.Delete()
End If
End Sub
Sub MoveDownList()
'Move Down List View.
Dim text, text1, row
On Error Resume Next
row = LV_Control.Items.focused.Index
text = LV_Control.Items.focused.text
text1 = LV_Control.Items.focused.text(1)
If row < LV_Control.Items.Count Then
row = row + 1
Speak " Moving Down "
AddListItem LV_Obj, FileListName, row, text & text1
LV_Control.Items.focused.Delete()
End If
End Sub
Bruce
Sent: Saturday, January 11, 2014 9:31 PM
Subject: Re: listbox change
Hi Again Jeff,
Now for a list box you have all rolled into one and the property using
FocusedIndex or method using SelectedIndex will give you the object index of
the one which has focus or is selected.
Long_Value = Object.FocusedIndex
Long_Value = Object.SelectedIndex
then you can get the data and text with the index in parens.
Bruce
Sent: Saturday, January 11, 2014 9:01 PM
Subject: listbox change
How can you find out when a focused listitem changes in a dialog?
I am trying to use select case and it works fine when a button is
pressed, but I want to find out when the user presses the up or down arrow in
the list itself.
thanks
Jeff Weiss
----------------------------------------------------------------------------
This email is free from viruses and malware because avast!
Antivirus protection is active.
------------------------------------------------------------------------------
This email is free from viruses and malware because avast! Antivirus
protection is active.
---
This email is free from viruses and malware because avast! Antivirus protection
is active.
http://www.avast.com