Sign in to follow this  
Followers 0
NELyon

Adding filenames into a listview

3 posts in this topic

#include <GUIConstants.au3>
; == GUI generated with Koda ==
$Form1 = GUICreate("AForm1", 622, 441, 192, 125)
$List1 = GUICtrlCreateList("", 16, 16, 193, 396, -1, $WS_EX_CLIENTEDGE)
$Button1 = GUICtrlCreateButton("Add", 264, 40, 137, 25)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button1
        GUICtrlSetData($List1,FileGetShortName(FileOpenDialog("Select a file to open",@ScriptDir, "All Files (*.*)")))
    EndSelect
WEnd
Exit

Is there a way to only display the file name, and not the whole file in the list? I used FileGetShortName, but it's still too long. Thanks,

Codemyster

Share this post


Link to post
Share on other sites



Use StringInStr to find the position of the last "\" and then stringmid everything after it.

Share this post


Link to post
Share on other sites

Is there a way to only display the file name, and not the whole file in the list? I used FileGetShortName, but it's still too long. Thanks,

use _PathSplit().

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0