Anyway, thank you very much for your help.
Powershell studio is a very good GUI tool
My problem above, already has a complete solution in other languages, but I am very interested, to know how to implement it in powershell studio
I will learn about powershell when there is enough time in the future.
My English is very bad, I use Google Translate, thank you
Select item in the list box, countdown will automatically press button
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.
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.
Re: Select item in the list box, countdown will automatically press button
I can give you an example of how to close the form with a timer.
Try this version of your form:
Try this version of your form:
- Attachments
-
- test form.psf
- (59.22 KiB) Downloaded 92 times
Re: Select item in the list box, countdown will automatically press button
Thank you for your help
Maybe I didn’t express it clearly,
1. When the countdown is over, perform the function of pressing the ok button, the selected items Output in the console
2. During the countdown process, if I perform other operations, such as clicking a form or selecting an item, the countdown will stop.
I think my problem, to achieve it, is very difficult
Maybe I didn’t express it clearly,
1. When the countdown is over, perform the function of pressing the ok button, the selected items Output in the console
2. During the countdown process, if I perform other operations, such as clicking a form or selecting an item, the countdown will stop.
I think my problem, to achieve it, is very difficult
Re: Select item in the list box, countdown will automatically press button
I don't understand why the following code has no output
Code: Select all
$buttonOK_Click = {
#TODO: Place custom script here
$checkedlistbox1.CheckedItems | Write-Host
$checkedlistbox2.CheckedItems | Write-Host
$checkedlistbox3.CheckedItems | Write-Host
}
Re: Select item in the list box, countdown will automatically press button
Because "CheckedItems" is not a value - it is a collection of objects that have checks.
Again. With no programming experience you will continuously make bad guesses. There is no substitute for knowing. Guessing never works in any programming language.
The link will not only teach you basic PowerShell but will also teach you the fundamentals of programming.
The form I psoted also tells you how to click the button.
Again. With no programming experience you will continuously make bad guesses. There is no substitute for knowing. Guessing never works in any programming language.
The link will not only teach you basic PowerShell but will also teach you the fundamentals of programming.
The form I psoted also tells you how to click the button.
Re: Select item in the list box, countdown will automatically press button
There are many issues with your form. The event is not connected to anything.winsoft wrote: ↑Sun May 19, 2019 4:29 pm Thank you for your help
Maybe I didn’t express it clearly,
1. When the countdown is over, perform the function of pressing the ok button, the selected items Output in the console
2. During the countdown process, if I perform other operations, such as clicking a form or selecting an item, the countdown will stop.
I think my problem, to achieve it, is very difficult
You need to slow down and learn how to do one thing first. When you learn how to use one control then you will have a better understanding of other controls.
The button is defined as the button that causes the form to close. The click will never be called.
The first issue you are creating for yourself is trying to design a form with absolutely no training or understanding of how forms work. Without learning what a form is and how it is intended to be used you cannot design a solution.
Always start by learning the simple things first. The videos and tutorials are there for those new to programming and forms/PowerShell. You cannot guess your way through this.
Re: Select item in the list box, countdown will automatically press button
My English is not very good, I don't know how to describe the problem.
Look at the picture may be more clear
I am learning other scripting languages, but I can't communicate its code here because it's not friendly.
I just got in touch with powershell gui programming, I found a software (powershell studio) using Google search, I am trying it out and I feel it is very easy to get started.
I tried to use it to complete examples of other scripting languages. If all goes well, I have plans to use powershell scripts to help my work.
The above is my real situation, I hope to get your understanding.
Look at the picture may be more clear
I am learning other scripting languages, but I can't communicate its code here because it's not friendly.
I just got in touch with powershell gui programming, I found a software (powershell studio) using Google search, I am trying it out and I feel it is very easy to get started.
I tried to use it to complete examples of other scripting languages. If all goes well, I have plans to use powershell scripts to help my work.
The above is my real situation, I hope to get your understanding.
- Attachments
-
- err.gif (345.79 KiB) Viewed 1620 times
Re: Select item in the list box, countdown will automatically press button
I don't understand why the same code (OK button), the result is different, maybe I am stupid, but I really checked many times
Re: Select item in the list box, countdown will automatically press button
GIFs do not explain your issue. The form I posted does what you ask as far as I can decode it. Without some basic knowledge of programming you will no be able to ask a clear question.
Sorry.
Sorry.