This depends entirely on where your rowsource comes from - ie - the RowSourceType. Even assuming your RowSourceType is simply 'Value', your second last line doesn't refer to the item being changed. Again, assuming a RowSource Type of 'Value', try this in the RightClick():
LOCAL llOk, lnCount
llOk = .F.
FOR lnCount = 1 TO This.ListCount
IF This.Selected(lnCount)
llOk = .T.
lnSelected = lnCount
lnCount = This.ListCount
ENDIF
ENDFOR
IF llOk
lcNewName = INPUTBOX("New Name:")
IF !EMPTY(lcNewName)
This.List(lnSelected) = lcNewName
ENDIF
ENDIF
This.Refresh()
>David
>
>Thanks for replying i tried in the rightclick event of the listbox
>rname=INPUTBOX('Enter the name for the file','Rename')
>if empty(rname)
> messagebox('You have to enter correct name for the file')
> return 0
>endif
>this.Value=rname
>this.Refresh
>
>
>but the item doesn't get refreshed.what am i missing.
>
>txs
>>Khan,
>>
>>You could add the functionality to the rightclick, pop open your own little form with a textbox on it to edit the value, or use InputBox() to get the value.
>>
>>>I would like to allow the users to rename the item in the list box,any idea how to get it done.