Support Forums

Search found 10807 matches

by jvierra
Wed May 24, 2017 8:04 am
Forum: Windows PowerShell
Topic: Button click executes the action twice
Replies: 1
Views: 60

Re: Button click executes the action twice

The best we can do is to suggest using the debugger to step through the code. I recommend that you rethink using global variables as control items. In most cases that I see you do not need them. Note that there is no way for us to run your code as it is totally dependent on your network. The form is...
by jvierra
Wed May 24, 2017 7:51 am
Forum: PowerShell GUIs
Topic: Create a DataGridView and export to a csv
Replies: 55
Views: 251

Re: Create a DataGridView and export to a csv

You will have to add a complete row or create a data table or collection that specifies complete rows. The DataNameProperty must match the table or collection name. Items = Get-ADComputer -Filter * -SearchBase 'OU=DOMUSERS,DC=DOM,DC=LOCAL' | Select Name, @{n='DomainAccount';e={''}} $DataGridView.Dat...
by jvierra
Wed May 24, 2017 1:02 am
Forum: PowerShell GUIs
Topic: Create a DataGridView and export to a csv
Replies: 55
Views: 251

Re: Create a DataGridView and export to a csv

What control are you adding it to?

YOu have to be clear and understand how the controls work. A cell or column cannot be added as a list.
by jvierra
Tue May 23, 2017 3:57 pm
Forum: PowerShell GUIs
Topic: Create a DataGridView and export to a csv
Replies: 55
Views: 251

Re: Create a DataGridView and export to a csv

You cannot add a range to a column. Items are added to the "Items" property of a grid. You cannot use both a table (datasource) and add items.
by jvierra
Tue May 23, 2017 3:55 pm
Forum: PowerShell GUIs
Topic: DataGridView select all
Replies: 5
Views: 42

Re: DataGridView select all

Cell sizes and other major components are set by the container and based on the configuration of the container. You cannot resize a cell except if you are manually generating each cell. If you are looking for odd effects then you will have to use the "paint" event to create a new graphic f...
by jvierra
Tue May 23, 2017 1:04 pm
Forum: PowerShell GUIs
Topic: DataGridView select all
Replies: 5
Views: 42

Re: DataGridView select all

You cannot change "SelectedCell". You can change the color of the cell template for selected and unselected.

$datagridview1.DefaultCellStyle.SelectionBackColor = 'Red'
$datagridview1.columns[0].CellTemplate.Size = '20,40'


Look up all of the properties you can set on the MSDN site.
by jvierra
Tue May 23, 2017 9:49 am
Forum: PowerShell GUIs
Topic: DataGridView select all
Replies: 5
Views: 42

Re: DataGridView select all

Set the form to not allow new items then there will be no empty record.

Look at the properties pane and you will see that most items can be sized and colored as needed.
by jvierra
Tue May 23, 2017 9:45 am
Forum: PowerShell GUIs
Topic: A better folderbrowserdialog - follow up
Replies: 3
Views: 33

Re: A better folderbrowserdialog - follow up

To use this function outside of a controlset you need to load and execute the function:

Code: Select all

. .\BuildDialog.ps1
BuildDialog
$fsd = New-Object FolderSelect.FolderSelectDialog
$fsd.ShowDialog()


All of this is done for you with PowerShell Studio. Just add the control set to the form.
by jvierra
Mon May 22, 2017 9:43 am
Forum: PowerShell GUIs
Topic: Background Jobs (Job Tracking Control Set)
Replies: 6
Views: 49

Re: Background Jobs (Job Tracking Control Set)

Here is a better format that cn help you keep it sorted out. $jobScript = { $emaillist = 'user@deomain.com', 'user@deomain.com', 'user@deomain.com' foreach($email in $emaillist){ Get-AdUser -Filter "EmailAddress -like '*$email*'" -Properties SamAccou...
by jvierra
Mon May 22, 2017 9:33 am
Forum: PowerShell GUIs
Topic: Background Jobs (Job Tracking Control Set)
Replies: 6
Views: 49

Re: Background Jobs (Job Tracking Control Set)

$results will be a collection of objects. What tis it you are expecting.

Stat by testing your job script at a CLI prompt until you get it t return what you need.

The script you posted cannot ever return anything. $count and $emailist are never defined.

Go to advanced search