PowerShell GUI component variables isolated from one another

Welcome Forums General PowerShell Q&A PowerShell GUI component variables isolated from one another

This topic contains 1 reply, has 2 voices, and was last updated by

6 months, 1 week ago.

  • Author
  • #100336

    Points: 1
    Rank: Member

    I am a newbie at working with PowerShell GUIs and I am working on something now that has me a bit confused.

    What I need help with is how to get a button component's associated action variable to see another component's?

    For example, if I have a button titled "Do Something" and I have a Date Time Picker component and I want to use the date from the Date Time Picker in my "Do Something" button's variable, how would I go about this?

    So, something like this:

    $DoSomething_Button_Click {

    I guess I am not able to add an image here, so I will just redirect to another post I have asking the same thing on TechNet here:

    Thanks for your help on this, much appreciated.

  • #100423

    Points: 27
    Rank: Member

    You can use $Date_DateTimePicker.Value in your message box. The Value property of DateTimePicker is a DateTime object.

    MSDN: DateTimePicker.Value

    At that point, you can manipulate the value like any other DateTime object in PowerShell, including outputting just the date as a string. You just need to know the format you want to use.

The topic ‘PowerShell GUI component variables isolated from one another’ is closed to new replies.