User Interface / Widgets / Buttons / Symbol Buttons
In This Topic
    Symbol Buttons
    In This Topic

    Symbol buttons are a special kid of buttons that besides a content can also have a symbol, for example an arrow, a check and so on. Just like with ordinary buttons you can use their Content property to set the their content, which can be any widget. The symbol can be controlled through the Symbol property of the symbol button's SymbolBox child. You can specify the spacing between the symbol and the content through the Spacing property and the symbol-content relation through the SymbolContentRelation property. Here's an example:

    Symbol Button Example
    Copy Code
    NSymbolButton symbolButton = new NSymbolButton("Symbol Button");
    symbolButton.SymbolBox.Symbol = NSymbol.Create(ENSymbolShape.TriangleDown, new NSize(10, 10), NColor.Red);
    symbolButton.SymbolContentRelation = ENSymbolContentRelation.ContentAboveSymbol;
    symbolButton.Spacing = 3;
    
    You can use the static Create method of the NSymbol class to quickly create commonly used shapes such as triangles, rectangles, ellipses and so on. Read more.

    The code above will create the following symbol button:

    Besides symbol buttons, you can also create symbol repeat buttons (through the NSymbolRepeatButton class) and symbol toggle buttons, such as radio buttons and check boxes.

    See Also