PowerShell GUI component variables isolated from one another

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.

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.