Hello,
This can be controled by Origin C, please refer to the code below:
#include <..\OriginLab\theme_utils.h>
void test_rich_text()
{
Worksheet wks = Project.ActiveLayer();
if ( wks )
{
Tree trFmt;
trFmt = wks.GetFormat(FPB_ALL, FOB_ALL & ~(FOB_LINK_STYLE|FOB_RANGE_STYLE), TRUE, TRUE);
TreeNode trTextFmt = theme_tree_get_node_by_name_strval(trFmt, STR_NAMESTYLE_LONG_NAME);
if ( trTextFmt )
{
trTextFmt.Style.Control.strVal = "Origin Text Edit"; //this set the column into rich text
trTextFmt.Style.Control.strVal = "Edit Control"; //this set the column into non rich text
if ( 0 == wks.UpdateThemeIDs(trFmt.Root) )
{
wks.ApplyFormat(STYLE_REPAINT | STYLE_RELATIVE | STYLE_UNDO | STYLE_COMPLETE, trFmt);
//after set as Rich Text, set long name to column
}
}
}
}
You can set all columns in worksheet into "rich text" by delete this row:
trTextFmt.Style.Control.strVal = "Edit Control";
Best regards!
Jason
OriginLab Technical Service