How can only valid characters be allowed in a Windows file system in a TextBox that can only appear as uppercase in Windows Forms?
Is there an easy way for this?
-
About the set of characters allowed in a Windows file system (
Char.IsLetterOrDigitis not enough) -
How do I make the typed characters uppercase?
Create a Textbox key press handler and Use
Path.GetInvalidPathChars(),Path.GetInvalidFileNameChars()to check for a valid char and return the uppercase version if the char is valid.[Of course, it would be more reusable to create a method rather than placing this code directly in the handler.]
UPDATED to reflect comments.