Show / Hide Table of Contents

Property toolbar.this


Overload

Adds button. Same as toolbar.Add.

public Action<TBItem> this[string text, MTImage image = default, int l_ = 0, string f_ = null] { set; }
Parameters
text  (string)

Text. Or "Text|Tooltip", or "|Tooltip", or "Text|". Separator can be "|" or "\0 " (then "|" isn't a separator). To always display text regardless of toolbar.DisplayText, append "\a", like "Text\a" or "Text\a|Tooltip".

image  (MTImage)

Image. Read here: MTBase.

l_  (int)

Caller info parameter

f_  (string)

Caller info parameter

Property Value
Action<TBItem>

Action called when the button clicked.

Remarks

More properties can be specified later (set properties of toolbar.LastTBItem or use toolbar.Items) or before (MTBase.ActionThread, MTBase.ActionException, MTBase.ExtractIconPathFromCode, MTBase.PathInTooltip).

Examples

These two are the same.

tb.Add("Example", o => print.it(o));
tb["Example"] = o => print.it(o);

These four are the same.

var b = tb.Add("Example", o => print.it(o)); b.Tooltip="tt";
tb.Add("Example", o => print.it(o)).Tooltip="tt";
tb["Example"] = o => print.it(o); var b=tb.Last; b.Tooltip="tt";
tb["Example"] = o => print.it(o); tb.Last.Tooltip="tt";