Firstly, you need to put double quotes around urlencode($file):
echo "<form method=\"post\" name=\"deleteFile\" action=\"delete.php?delete=true\">
<input type=\"hidden\" name=\"FileToDelete\" value=\"".urlencode($file)."\" >
<input class=\"delete_button\" type=\"submit\" value=\"X\"></div></form>";
Secondly, you want urldecode($POST["FileToDelete"]) and not $POST[urldecode("FileToDelete")]:
echo urldecode($_POST["FileToDelete"]) . ' #1' . '<br>';
As it's written, your code is urldecoding the string "FileToDelete" which is just an array key and not the value submitted in your form. As this array key has only letters in it, it doesn't change anything.
Also, urlencode will probably work to keep a string from breaking your html, but you probably want to use [man]htmlspecialchars[/man] instead. This turns angle brackets (< and >) and quotes (' and ") into their html-encoded equivalents.