Product, version and build: 5.2.128.0
32 or 64 bit version of product: 64
Operating system: Win 7 Pro x64
32 or 64 bit OS:
PowerShell Version: V5
DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
When running a command in a text box, it cuts the character limit to this amount
3.5.30730.0 MICROSOFT CHART CONTROLS FOR MICROSOFT .NET FRAMEWORK 3.5 (K...
The command is to pull the displayversion and program name off of the computer so technicians can copy and paste it into the ticket.
If I run this in ISE or run it in PowerShell studio I get this
3.5.30730.0 MICROSOFT CHART CONTROLS FOR MICROSOFT .NET FRAMEWORK 3.5 (KB2500170)
Just wanted to bring attention to this
Length of Textbox
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.
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.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: Length of Textbox
[Moved by moderator]
That is not a product problem. A standard text box does not cut text like that. You should check the properties you have set.
That is not a product problem. A standard text box does not cut text like that. You should check the properties you have set.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- dan.potter
- Posts: 709
- Last visit: Wed Nov 14, 2018 11:39 am
Re: Length of Textbox
Make the textbox larger. It will only display as many characters as it has width for. The characters are all there except if you are using Format-Table to get the text. Don't use any Format commands when retrieving text. The Format commands will truncate column widths.
The "ellipses" in you string show that your retrieval method truncated the text before putting it in the textbox:
3.5.30730.0 MICROSOFT CHART CONTROLS FOR MICROSOFT .NET FRAMEWORK 3.5 (K...
You can easily overcome this by placing button on the form that copies the desired text to the clipboard.
[system.Windows.Forms.Clipboard]::SetText($textbox1.Text)
The "ellipses" in you string show that your retrieval method truncated the text before putting it in the textbox:
3.5.30730.0 MICROSOFT CHART CONTROLS FOR MICROSOFT .NET FRAMEWORK 3.5 (K...
You can easily overcome this by placing button on the form that copies the desired text to the clipboard.
[system.Windows.Forms.Clipboard]::SetText($textbox1.Text)
Re: Length of Textbox
We've already been over this - viewtopic.php?f=21&t=10580&start=20
This is why I pasted this thread in the application forum and not the scripting forum
I'm going to break this down as clear as possible... Lets start with the easy items..
My textbox is 920, 427 ( plenty big ) - my form is 950, 650
My monitors are 1920x1080
The application has been in development since March and I'm the only coder
This application is to be ran from a technicians PC while on the phone with the customer getting information from their computer for our tickets....
It populates a lot of data for us - almost 300 lines of text
When I run my code or jvierra's code in PowerShell Studio - it's exactly as I want it (zero truncating).
If I build jvierras VS running mine inside PSStudio - you can see my problem. The app on the left is the one jvierra sent over that is running as an .exe, the one on the right is running inside PSS
I'm not trying to be a tool but it's clear there is a truncating problem after the update.
Just another thing to point out to prove I'm not blowing smoke - Top script is mine, bottom is jvierras - you can tell we write code differently but it's the exact same.
I also have this exact same code somewhere else in the application that only displays the applications and it does the same truncating.
Now to the replies:
As you can see I have a copy text button, pulls exactly what's in the text box 100% of the time.
This is why I pasted this thread in the application forum and not the scripting forum
I'm going to break this down as clear as possible... Lets start with the easy items..
My textbox is 920, 427 ( plenty big ) - my form is 950, 650
My monitors are 1920x1080
The application has been in development since March and I'm the only coder
This application is to be ran from a technicians PC while on the phone with the customer getting information from their computer for our tickets....
It populates a lot of data for us - almost 300 lines of text
When I run my code or jvierra's code in PowerShell Studio - it's exactly as I want it (zero truncating).
If I build jvierras VS running mine inside PSStudio - you can see my problem. The app on the left is the one jvierra sent over that is running as an .exe, the one on the right is running inside PSS
I'm not trying to be a tool but it's clear there is a truncating problem after the update.
Just another thing to point out to prove I'm not blowing smoke - Top script is mine, bottom is jvierras - you can tell we write code differently but it's the exact same.
I also have this exact same code somewhere else in the application that only displays the applications and it does the same truncating.
Now to the replies:
If I remove the | ft - autosize ..... Still truncatesjvierra wrote:Make the textbox larger. It will only display as many characters as it has width for. The characters are all there except if you are using Format-Table to get the text. Don't use any Format commands when retrieving text. The Format commands will truncate column widths.
The "ellipses" in you string show that your retrieval method truncated the text before putting it in the textbox:
3.5.30730.0 MICROSOFT CHART CONTROLS FOR MICROSOFT .NET FRAMEWORK 3.5 (K...
You can easily overcome this by placing button on the form that copies the desired text to the clipboard.
[system.Windows.Forms.Clipboard]::SetText($textbox1.Text)
As you can see I have a copy text button, pulls exactly what's in the text box 100% of the time.
Provideddan.potter wrote:running a command in a textbox?
Include your code.
Re: Length of Textbox
You cannot run a command in a textbox. You can add text to a textbox and you can type text into a textbox.
You are posting many pictures but there is not sign of the code you are using to copy into the textbox. Without a simple example of the code that fails we cannot begin to guess at the cause of your issue.
Simplify. Create a simple form with a textbox an the code that loads the textbox that shows the issue.
I see in one picture you are using Format-Table. This will truncate columns automatically. If you want al of the text to be displayed you need to NOT use Format commands and create a simple string output.
Post a PSF that demonstrates the issue and we will look at it.
You are posting many pictures but there is not sign of the code you are using to copy into the textbox. Without a simple example of the code that fails we cannot begin to guess at the cause of your issue.
Simplify. Create a simple form with a textbox an the code that loads the textbox that shows the issue.
I see in one picture you are using Format-Table. This will truncate columns automatically. If you want al of the text to be displayed you need to NOT use Format commands and create a simple string output.
Post a PSF that demonstrates the issue and we will look at it.
Re: Length of Textbox
jvierra wrote:You cannot run a command in a textbox. You can add text to a textbox and you can type text into a textbox.
You are posting many pictures but there is not sign of the code you are using to copy into the textbox. Without a simple example of the code that fails we cannot begin to guess at the cause of your issue.
Simplify. Create a simple form with a textbox an the code that loads the textbox that shows the issue.
I see in one picture you are using Format-Table. This will truncate columns automatically. If you want al of the text to be displayed you need to NOT use Format commands and create a simple string output.
Post a PSF that demonstrates the issue and we will look at it.
Seriously???
3rd picture is my code vs your code
You didn't even read my entire thread.
I'm not running a command inside of a textbox.
Re: Length of Textbox
So can someone tell me why it runs just fine in ISE or when running the application inside of PSStudio?jvierra wrote:I see you are using a "found function" called Get-RemoteProgram. It is this function that is causing y0ur issues. It generates broken objects because of how it is designed.
It's funny, our first time around you mentioned no such thing of the function creating broken objects.
We're really running out of options here until it points to PS Studio
- rmckay9969
- Posts: 63
- Last visit: Fri Feb 01, 2019 6:51 pm
Re: Length of Textbox
What you are experiencing looks eerily similar to a problem I had a while back. See if using the width parameter solves your problem. example below...
- $Var | Out-File $env:temp\Result.txt -width 400 # -Width Prevents Truncation in this instance