// JavaScript
Navs1.onclick = function(i) {
if (typeof i == "object") return;
NSB.MsgBox("Item clicked: " + Navs1.value);
};
(11 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
'''''This control was added in Bootstrap 4.''''' | |||
[[file:BsNavs.png]] | [[file:BsNavs.png]] | ||
Line 8: | Line 10: | ||
Standard [[properties and methods|properties]] are supported, plus: | Standard [[properties and methods|properties]] are supported, plus: | ||
{| class=" | {| class="wikitable" | ||
|- | |||
| addItem(''item'', ''active'', ''disabled'') || Add an ''item''. ''active'' and ''disabled'' are true/false. Runtime. | |||
|- | |||
| clear() || Remove all items. Run Time. | |||
|- | |- | ||
| items || Items to show, one per line. Prefix * for disabled, > for selected. Design Time. | | items || Items to show, one per line. Prefix * for disabled, > for selected. Design Time. | ||
Line 14: | Line 20: | ||
| justified || How do the items spread to fit? 'justified' or 'fill'. Design Time. | | justified || How do the items spread to fit? 'justified' or 'fill'. Design Time. | ||
|- | |- | ||
| | | tabstyle || How do the Navs look? Navs is an outline, Pills look like buttons. Design Time. | ||
|- | |||
| value || Gets/sets the selected item. Starts from 0. Returns -1 if none selected. Run Time. | |||
|- | |||
| vertical || If set to true, the items will be arranged vertically. Design Time | |||
|- | |- | ||
|} | |} | ||
Line 23: | Line 32: | ||
Standard [[events|events]] are supported. For this control, the onclick event will be most useful. | Standard [[events|events]] are supported. For this control, the onclick event will be most useful. | ||
== Example ( | == Example == | ||
< | |||
<tabber> | |||
JavaScript= | |||
<syntaxhighlight lang="JavaScript"> | |||
// JavaScript | |||
Navs1.onclick = function(i) { | |||
if (typeof i == "object") return; | |||
NSB.MsgBox("Item clicked: " + Navs1.value); | |||
}; | |||
</syntaxhighlight> | |||
|-| | |||
BASIC= | |||
<syntaxhighlight lang="vb.net"> | |||
' Basic | |||
Function Navs1_onclick(i) | Function Navs1_onclick(i) | ||
If TypeName(i) = "object" Then Exit Function | If TypeName(i) = "object" Then Exit Function | ||
MsgBox "Item clicked: " | MsgBox "Item clicked: " & Navs1.value | ||
End Function | End Function | ||
</ | </syntaxhighlight> | ||
</tabber> | |||
</ | |||
== Output == | == Output == | ||
Line 47: | Line 62: | ||
[[Category:Bootstrap]] | [[Category:Bootstrap]] | ||
This control was added in Bootstrap 4.
Provide navigation links with customizable appearance.
Standard properties are supported, plus:
addItem(item, active, disabled) | Add an item. active and disabled are true/false. Runtime. |
clear() | Remove all items. Run Time. |
items | Items to show, one per line. Prefix * for disabled, > for selected. Design Time. |
justified | How do the items spread to fit? 'justified' or 'fill'. Design Time. |
tabstyle | How do the Navs look? Navs is an outline, Pills look like buttons. Design Time. |
value | Gets/sets the selected item. Starts from 0. Returns -1 if none selected. Run Time. |
vertical | If set to true, the items will be arranged vertically. Design Time |
Standard events are supported. For this control, the onclick event will be most useful.
// JavaScript
Navs1.onclick = function(i) {
if (typeof i == "object") return;
NSB.MsgBox("Item clicked: " + Navs1.value);
};
' Basic
Function Navs1_onclick(i)
If TypeName(i) = "object" Then Exit Function
MsgBox "Item clicked: " & Navs1.value
End Function