opendialogbox

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 1 year and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
olivier56
Posts: 16
Last visit: Tue Jan 09, 2024 6:58 am

opendialogbox

Post by olivier56 »

hi,
i would like have only the name of selected object and note the complet name in text.

$openfiledialog1.ShowDialog()
$textbox1.Text=$openfiledialog1.FileName
$textbox1.Text "C:\Program Files\Angry IP Scanner\ipscan.exe" i just need "ipscan.exe"

br
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Wed Mar 27, 2024 1:54 pm
Answers: 39
Been upvoted: 30 times

Re: opendialogbox

Post by brittneyr »

[Topic moved by moderator to PowerShell GUIs Forum]
Brittney
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: opendialogbox

Post by jvierra »

Use the built-in Net file objects:

([System.IO.FileInfo]$openfiledialog1.FileName).Name
This topic is 1 year and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked