Progress Bar blog post

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 8 years and 3 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
User avatar
localpct
Posts: 397
Last visit: Thu Oct 27, 2022 5:57 am

Progress Bar blog post

Post by localpct »

https://www.sapien.com/blog/2011/07/14/ ... r-control/

So I understand this completely, all but one aspect. I'm creating application that backs up a selected folder to whatever folder I choose.

The problem is this line

$destination = ('{0}\\Backup' -f $selectedPath)

What I'd like it to be is the name of the selected source folder so for example I'm backing up someones users profile

I want it to create a folder with the users profile so Adam for example

Hopefully that makes sense.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Progress Bar blog post

Post by jvierra »

I am sorry but your question is very hard to understand. Can you clarify what you are trying t ask?
User avatar
localpct
Posts: 397
Last visit: Thu Oct 27, 2022 5:57 am

Re: Progress Bar blog post

Post by localpct »

Instead of the script creating a folder named backup, I want it to create the selectedfolder

So I want it to be

C:\Users\steve\Desktop\!TestROBOCOPY\10 Extract

not

C:\Users\steve\Desktop\!TestROBOCOPY\Backup
Attachments
11-27-2015 9-53-44 PM.png
11-27-2015 9-53-44 PM.png (9.23 KiB) Viewed 4157 times
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Progress Bar blog post

Post by jvierra »

What script are you referring to?
User avatar
localpct
Posts: 397
Last visit: Thu Oct 27, 2022 5:57 am

Re: Progress Bar blog post

Post by localpct »

From the blog post sir that I posted first :)
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Progress Bar blog post

Post by jvierra »

The blog post is using a progress bar. You are asking about how to change a folder. The input boxes are there to allow you to type in a different value than the default. If you want a different default then just change the default in the code.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Progress Bar blog post

Post by jvierra »

localpct wrote:Instead of the script creating a folder named backup, I want it to create the selectedfolder

So I want it to be

C:\Users\steve\Desktop\!TestROBOCOPY\10 Extract

not

C:\Users\steve\Desktop\!TestROBOCOPY\Backup
Just change the txt in the template.

$destination = ('{0}\\10 Extract' -f $selectedPath)
User avatar
localpct
Posts: 397
Last visit: Thu Oct 27, 2022 5:57 am

Re: Progress Bar blog post

Post by localpct »

But that will make it static and I'd like to make it dynamic.

And the text box and button are the Textbox - Browse for folder from Control Sets
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Progress Bar blog post

Post by jvierra »

What does dynamic mean? The code you reference assigns a value to the string. If you have different code then please post it.
User avatar
dan.potter
Posts: 709
Last visit: Wed Nov 14, 2018 11:39 am

Re: Progress Bar blog post

Post by dan.potter »

dynamic from where? Create a selected folder?

$folderbrowserdialog1.ShowDialog()

Write-Host $folderbrowserdialog1.SelectedPath
This topic is 8 years and 3 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