Richtextbox Control

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.
Locked
ClipperXTP
Posts: 27
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Tue Apr 28, 2020 4:07 am

Richtextbox Control

Post by ClipperXTP »

Hi
I have an issue whereby I have a Powershell Studio tool with limited real estate.

I have 15 richtextboxes, all uniform size to look nice, which display results of queries.

This is fine when the result isnt too long.

It gets a bit ugly when say the result is say 10 - 15 characters too long for richtextbox.

It started by displaying a vertical scroll bar which looked really nasty so I turned off multiline.

I then reduced the font size which is OK but the text is jammed up at the top of the textbox.

I wouldn't mind leaving the font at the oringinal size and let it overrun the textbox if I was able to hover the mouse and have the full text pop up as it does in a datagridview when the text overruns - is this an option for richtextbox control? I can't see it.

Otherwise, how can I center the font vertically?
thanks

jvierra
Posts: 14444
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Richtextbox Control

Post by jvierra »

The best way to get going with a RichTextBox control is to look at the examples and read teh properties and methods of the control.

https://docs.microsoft.com/en-us/dotnet ... etcore-3.1

Turning of multi-line will make the textbox display all contents on one line.
I suspect you really want to use a TextBox and not a RichTextBox.

Locked