Output multiline textbox to variable in PowerShell WinForm - winforms

I have a WinForm in PowerShell where email contents are copied into a multiline textbox, output to a variable, and sent to a recipient on button press.
Everything works perfectly except the content from the textbox does not remain multiline.
Is it possible to extract the entered text and output in the same format?
I've attempted using TextBox and RichTextBox, splitting etc but unable to get it to work.
Thanks

You could try pulling $textBox.Lines instead of $textBox.Text.
This will give you an array of textlines in the box you can join together with the appropriate newline:
# for normal text:
$textEntered = $textBox.Lines -join [Environment]::NewLine
# for HTML:
$textEntered = $textBox.Lines -join '<br />'

Related

How to fit search tags and input onto same line of ui-select multiple select?

If you look at the ui-select tutorial, and click on Multiple Selection, you see multiple selection dropdowns where once you select at least one, you get at least two "lines", which will contain the already selected entries, until the last line, in which you can search/select other entries in the dropdown.
Is there no way to put both the already selected entries and the search feature on the same line? That makes the most sense to me. Alternatively I'd be fine if there could be placeholder text where the "|" pipe is that says "enter text here" or something, but that seems impossible.
Thanks for your time.
You can apply a width: auto; to the input, i see that it has a fixed with in the plnkr examples.
Sample plnkr

Search text from textbox using dialog in Silverlight

I have reachtextbox and want to search text like notepad in silverlight in separate dialog.. Find text and search that text in huge text entered in richtextbox.
How can I do it using separate dialog like notepad and search text and edit and highlight it in richtextbox?
I'd use a Mediator to send messages between search form and text form. You can declare an event like "OnSearch" in your search form and suscribe to it from your text form. When the event raises, you should send an eventarg with the string you want to search.
The text form should suscribe to the "searchMessage" with a string parameter. The Business layer for text form should implement a "search" method that looks for every string/substring depending on your search options. Then change text color for each coincidence.
Searching strings:
http://msdn.microsoft.com/en-us/library/ms228630(v=vs.80).aspx
You can also use the Find method in RichTextBox.
To change the color of that text you have to set the text as selected and then change the color of that selection:
SelectionStart, SelectionLenght, SelectionColor.

How to display the combobox selected value in textbox in wpf

I am working on WPF application. I have a window which has "Combobox" and "Textboxes". Well, I want to display the selected combobox values in textbox. (Combo Box displays the concatenated string firstname+lastname+initials). But I have two text box for firstname & second name. I want to display only "firstname" in first text box and "last name" in second text box.
I wrote the below code. IT displays the values but concatenated. IS there any way I can just display first name in first text box and last name in second text box.
Thanks.
FNSysEngnrTextBox.Text = SysEngnrCB.SelectedItem.ToString
LNSysEngnrTextBox.Text = SysEngnrCB.SelectedItem.ToString
Since SelectedItem is an Object you get the full Type prefacing your data when you use the ToString Method. I was able to get the result you were looking for by using String.Split. See if this works for you.
Dim delineators() As Char = {":", ",", "{", "}"}
Dim substrings() As String = SysEngnrCB.SelectedItem.ToString.Split(delineators)
FNSysEngnrTextBox.Text = substrings(1)
LNSysEngnrTextBox.Text = substrings(2)
I am not particular familiar with your platform, but I think
LNSysEngnrTextBox.Text should be
LNSysEngnrTextBox.Value or LNSysEngnrTextBox.Val

Display memo fields in VFP

How to display the content of memo fields with select command?
If I have a table (vendors) with the following fields: id_vendor C(10),address M and I want to display all the content with "select * from vendors" I receive only the type of field but not the content.
If you are viewing the results in a browse window (which is what executing the SQL will show), then ctrl+pgdown in the field (where it is showing "Memo") will display the entire contents in a new window.
The SQL did retrieve the entire contents, which can be confirmed by in the command windows entering
? [fieldname]
And you will see the contents that way also.
Which language are you using or what it your output audience... if within VFP, use an EDIT field to allow for multiple row content to be shown. In a simple "text box" field, it will only show "memo" as you indicate. Otherwise, as Swordblaster indicated ctrl+pgdown or even double-clicking SHOULD open it, but that would throw up an uncontrolled "window" for you vs a controlled "edit box" control which you can specifically place in your window as needed.
Double click Memo and the contents are displayed in a new window.

Reporting Services 2008 Visibility

Using reporting services and trying to hide a field placeholder value when it does not equal "View" The value is hyperlinked to a subreport and is located in a bordered textbox inside a tablix. If I use the visibility feature for the text box, I can hide the non-view hyperlinks with an expression, but it hides the entire textbox and the textbox borders go away for that cell--I really want them to remain and just show the empty cell. If, instead, I try to hide the value on the placeholder level, which does not present the visibility option, and I attempt to evaluate the expression for the placeholder value to Nothing or '' when it is not valued as "View" then I get a hyperlink dash display in the column where I think it's attempting to render an unvalued hyperlink, which I really don't want. I just want an empty, bordered textbox.
Any way around this?
One solution is to change the visibility of the textbox value like this
IIF(fields(View.value) = 'true' , fields(TextBoxVariable.value), " ")
note that " " at the end will hide your dash
Or you can put a rectangle in the tablix cell and set its border, the you can put a textbox inside of the rectangle and change the visibilityof the textbox easily
put you link action on placeholder properties: Action - go to subreport, then put hidden expression on textbox: IIF(Fields!NameFields="View", true, false)
it works for me.
I know this is an old post, but I recently ran into this same issue.
Remove the expression from the text box properties and add it to the expression box of the field (right-click on the field and instead of choosing Text Box Properties>Visibility, choose Expression from the context menu). This will replace the field with an expression and the border lines will still exist.
Here's what I added to my expression:
=IIF(FORMAT(CDATE(Fields!ApprovedDate.Value),"dd-mm-yyyy") > "01-01-1980",Fields!ApprovedDate.Value," ")
I think that the easiest way to get rid off this hyperlink dash, is to change the font effect of the text-box. Just select Font-tab from text-box properties and from there, click fx-button of Effects and put somethin like this as expression:
=IIF(Fields!YourValueField.Value is nothing, "None", "Underline")

Resources