Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
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.
This topic is 5 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
$buttonSEARCH_Click= {
[System.Windows.Forms.MessageBox]::Show($BindingURL') # <==== get the value of the variable
[xml]$file = (Get-Content 'c:\test\programdata\Server Configuration.xml')
$detailsLBL.Text = $file.SelectSingleNode("//Instance[BindingHostName='$BindingURL']").Name
}
I don't know where that code is. What you are talking about is a text box Named BindingURL. I enter text in this box and I assumed that the variable is set then. Please correct me if I'm wrong.
How can you not know where the code is? You wrote it didn't you.
It sounds to me like the variable is not a simple text variable. If it is the text box then it is an object. I posted twice telling you how to determine what you have. Please go back and address the posts you ignored. They outline how to determine the issue and how to fix it.
I had a couple of minutes to kill so here is an example form showing how to use my XML code to query from a textbox and update a control. It is very simple.
That made me see the light. The problem was with me not assigning the $BindingURL.text to a variable after the user clicked the search button. Now I remember how to do it. thanks for the guidance.
This topic is 5 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.