Syntax 2: for RibbonBar controls
Description
Inserts a category in the RibbonBar control.
Applies to
RibbonBar controls
Syntax
|
1 |
controlname.InsertCategory ( Long ItemHandleAfter, String Text ) |
|
1 |
controlname.InsertCategory ( Long ItemHandleAfter, RibbonCategoryItem Item ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the RibbonBar control. |
|
ItemHandleAfter |
The handle of the category on the same level after which |
|
Text |
The title of the category to be inserted. |
|
Item |
A category item to be inserted. |
Return value
Long.
Returns the handle of the inserted item if it succeeds and -1 if
an error occurs. If any argument’s value is null, returns null.
Example 1
This example inserts the “MyCategory2” category after the
“MyCategory1” category.
|
1 2 3 4 |
Long ll_Handle, ll_Handle2 ll_Handle = rbb_1.InsertCategoryFirst ( "MyCategory1" ) ll_Handle2 = rbb_1.InsertCategory ( ll_Handle, "MyCategory2" ) |
Example 2
This example also inserts the “MyCategory2” category after the
“MyCategory1” category. It first defines a category item with various
properties (including Text, Tag etc.) and then inserts it after the
“MyCategory1” category.
|
1 2 3 4 5 6 7 |
Long ll_Handle,ll_Handle2 RibbonCategoryItem lr_Category ll_Handle = rbb_1.InsertCategoryFirst ("MyCategory1") lr_Category.Text = "MyCategory2" lr_Category.Tag = "MyCategory2" ll_Handle2 = rbb_1.InsertCategory (ll_Handle, lr_Category) |
See also