To help you better we need some information from you.
*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***
Product, version and build: Sapien Powershell Studio 2017
32 or 64 bit version of product:
Operating system: W10
32 or 64 bit OS:64bit
*** Please add details and screenshots as needed below. ***
I'm busy creating a script which ran fine this morning.
A couple of hours later, the application freezez/crashed when I select the combobox. (so before I'm able to select or type, the application freezes)
I get no errors... the app just freezes.
$button_DL_generateList = button used to populate my array $DL_all
$combo_DL_remove = my combobox
$button_DL_generateList_Click = {
$lbl_DL_loading.Visible = $true
$button_DL_generateList.Visible = $false
#put all active groups in array so group can be choosen from dropdown
$DL_all = @()
$DL_all = Get-DistributionGroup -Filter { (name -notlike "security-*") -and (name -notlike "security_*") } -ResultSize unlimited | select-object Name
$DL_all.getenumerator() |
foreach {
new-object psobject -Property @{ 'Name' = $_.name }
$combo_DL_remove.Items.Add($_.name)
}
$combo_DL_remove.Enabled = $true
$lbl_DL_loading.Visible = $false
$button_DL_generateList.Visible = $true
}
Combobox causes crash/freeze
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.
- tvandenberghe@cochlear.com
- Posts: 9
- Last visit: Tue Sep 26, 2017 3:37 am
Re: Combobox causes crash/freeze
[TOPIC MOVED TO POWERSHELL GUIS FORUM BY MODERATOR]
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Combobox causes crash/freeze
Your code would be cleaner and faster if you do it like this:
Code: Select all
$button_DL_generateList_Click = {
$lbl_DL_loading.Visible = $true
$button_DL_generateList.Visible = $false
#put all active groups in array so group can be choosen from dropdown
$filter = {name -notlike 'security-*' -and name -notlike 'security_*' }
$DL_all = Get-DistributionGroup -Filter $filter | select-object -expand Name
$combo_DL_remove.Items.AddRange($DL_all)
$combo_DL_remove.Enabled = $true
$lbl_DL_loading.Visible = $false
$button_DL_generateList.Visible = $true
}
- tvandenberghe@cochlear.com
- Posts: 9
- Last visit: Tue Sep 26, 2017 3:37 am
Re: Combobox causes crash/freeze
@jvierra : it's cleaner for sure !
(I re-added the -ResultSize unlimited)
But still the app freezes when I click on the combo.
In debug : no errors are shown.
(I re-added the -ResultSize unlimited)
But still the app freezes when I click on the combo.
In debug : no errors are shown.
- tvandenberghe@cochlear.com
- Posts: 9
- Last visit: Tue Sep 26, 2017 3:37 am
Re: Combobox causes crash/freeze
The code first populates the combobox.
When it has finished populating, the combobox becomes enabled.
As soon as you click on the combo to type, or when clicking on the small arrow to scroll : the app freezes, then after some seconds refreshes and the combobox is again empty. (=contains no values)
When it has finished populating, the combobox becomes enabled.
As soon as you click on the combo to type, or when clicking on the small arrow to scroll : the app freezes, then after some seconds refreshes and the combobox is again empty. (=contains no values)
- tvandenberghe@cochlear.com
- Posts: 9
- Last visit: Tue Sep 26, 2017 3:37 am
Re: Combobox causes crash/freeze
Before populating the combo
When the combo is populated
When the combo is selected to start typing
- tvandenberghe@cochlear.com
- Posts: 9
- Last visit: Tue Sep 26, 2017 3:37 am
Re: Combobox causes crash/freeze
-not 1 single event linked to this combo.
-changed my filtering so I get only 3 values. Populating the combo goes very fast now, but when selecting the combo the issue reoccurs. (freeze)