Textbox Selected Item to String?

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 forum is a space to discuss coding involving Graphical User Interfaces (GUI) in PowerShell or using WinForms controls, and technical issues related to development.

- Question about a licensed SAPIEN product? Post here: Product Support for Registered Users
- Question about a trial SAPIEN product? Post here: Former and Future Customers - Questions
This topic is 1 month and 2 weeks 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.
Locked
mwilliamsocc
Posts: 11
Last visit: Fri Oct 18, 2024 4:31 pm
Has voted: 1 time

Textbox Selected Item to String?

Post by mwilliamsocc »

I know I have done this plenty of times before but I cannot get it to work today.

I have a textbox that I populate with items from Active Directory. I want the selected item to show up in another (single line) text box.

I attempted something like the following:
  1.    
  2. $selectedGRP = $txtbGrpUsers.SelectedText
  3.     $StringText = $selectedGRP.ToString()
  4.     $textbox2.Text = $StringText
But this does not work for me... Code complete doesnt even like "selectedtext" which is what I found when doing google searches searching for help on this. I know this is super rudimentary and apologize for bugging the collective with it.

Thanks for your help!
This topic is 1 month and 2 weeks 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.
Locked