Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to allow users to rename the item in the list box.
Message
From
13/11/2002 14:18:16
 
 
To
13/11/2002 13:28:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00721778
Message ID:
00722296
Views:
17
This message has been marked as a message which has helped to the initial question of the thread.
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.

* find out if anything is actually selected
FOR lnCount = 1 TO This.ListCount
   IF This.Selected(lnCount)   && ok, something is
      llOk = .T.
      lnSelected = lnCount     && set a variable to the index
      lnCount = This.ListCount && break out of the loop
   ENDIF
ENDFOR

IF llOk
   lcNewName = INPUTBOX("New Name:")  && get new input
   IF !EMPTY(lcNewName)               && ignore if empty
      This.List(lnSelected) = lcNewName  && change value of the selected item
   ENDIF
ENDIF
This.Refresh()   && refresh the listbox
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform