Search found 13898 matches

by jvierra
Fri Nov 15, 2019 8:09 pm
Forum: PowerShell GUIs
Topic: Cant get add_click event to return or pass data using monthcalendar
Replies: 1
Views: 49

Re: Cant get add_click event to return or pass data using monthcalendar

The syntax of the code is wrong and the code makes little sense.

This is the best guess at what you are trying to do:

Code: Select all

for($MO = $cal.SelectionRange.Start;$MO -le $cal.SelectionRange.End;$MO = $MO.AddDays(1)){  
    Write-Host $MO #| get-date -Uformat %B
}
by jvierra
Fri Nov 15, 2019 2:47 pm
Forum: PowerShell GUIs
Topic: Keep child form open and append data to main form
Replies: 13
Views: 137

Re: Keep child form open and append data to main form

There are quite a number of articles on GUI design here: https://info.sapien.com/index.php/guis/ ... nistrators

There are many articles on the left menu on the linked page.
by jvierra
Fri Nov 15, 2019 12:20 pm
Forum: PowerShell GUIs
Topic: Keep child form open and append data to main form
Replies: 13
Views: 137

Re: Keep child form open and append data to main form

A label control can display text centered.
by jvierra
Fri Nov 15, 2019 10:30 am
Forum: PowerShell GUIs
Topic: Keep child form open and append data to main form
Replies: 13
Views: 137

Re: Keep child form open and append data to main form

Not really. You would have to code all of that and I wouldn't use an RTB,
by jvierra
Fri Nov 15, 2019 9:12 am
Forum: PowerShell GUIs
Topic: Populate Datagridview with Selected record from another Datagridview
Replies: 3
Views: 65

Re: Populate Datagridview with Selected record from another Datagridview

Here is the CopyTo method of the RowCollection. Send the SelectedRows object and use it with CopyTo to insert the rows in the child form grid.
by jvierra
Fri Nov 15, 2019 9:07 am
Forum: PowerShell GUIs
Topic: Populate Datagridview with Selected record from another Datagridview
Replies: 3
Views: 65

Re: Populate Datagridview with Selected record from another Datagridview

You can copy a row between grids using the row copy method. Between forms sending the row object will work but it likely needs to be cloned.
by jvierra
Fri Nov 15, 2019 9:03 am
Forum: PowerShell GUIs
Topic: Keep child form open and append data to main form
Replies: 13
Views: 137

Re: Keep child form open and append data to main form

No. You can update controls on the main form by passing the control to the child as a parameter. We do it all of the time.
by jvierra
Fri Nov 15, 2019 8:15 am
Forum: PowerShell GUIs
Topic: Keep child form open and append data to main form
Replies: 13
Views: 137

Re: Keep child form open and append data to main form

Also you can access the mainform's variables directly as they should be in scope. Just refrence the variable for the textbox you want to write to. If it is called "$richtextbox1" then you can access it like this: $richtextbox1.AppendText('my message') If the dialog is aborting then you may have issu...
by jvierra
Fri Nov 15, 2019 8:00 am
Forum: PowerShell GUIs
Topic: Keep child form open and append data to main form
Replies: 13
Views: 137

Re: Keep child form open and append data to main form

The parent form is not accessible from the child by any normal means. Pass the control as a parameter to the child and add the text to the control object passed.