For the .NET ToolStripButton, is it possible to have a Text property with multiple lines?

I have an image toolbar and I want labels on the labels. If text labels are multiple words, I would like the words to be vertical. How can i do this?

+4
source share
3 answers

To clarify Paulo's answer:

You cannot perform multi-line processing during development. But at runtime, you can set the .Text property of each ToolStripButton as follows:

ToolStripButton1.Text = "This is " & ControlChars.CrLF & "a button."

This will give you a multi-line display for your text.

+7
source

VS UI, . CrLf .

+2

There is still no support in the VS user interface for this in 2019. But you can put this after InitializeComponent () in the constructor as a simple workaround:

foreach (ToolStripItem tsi in tsMain.Items)
{
  tsi.Text = tsi.Text.Replace("|", Environment.NewLine);
}

And use "|" as a placeholder for a new line in the designer.

+1
source

Source: https://habr.com/ru/post/1710855/


All Articles