var cf2 = mainForm.richedit.getSelCharformat();
cf2.mask = 0x800000/*_CFM_UNDERLINETYPE*/ | 0x4 /*_CFM_UNDERLINE*/;
// 有下划线
if( cf2.effects & 0x4/*_CFE_UNDERLINE*/) {
console.log("有下划线")
cf2.effects = cf2.effects & ~(0x4)/*_CFE_UNDERLINE*/;
cf2.underlineType = 0 /*_CFU_UNDERLINENONE*/;
mainForm.richedit.setSelCharformat(cf2)
}
// 没有下划线
else {
console.log("没有下划线")
cf2.effects = cf2.effects | (0x4)/*_CFE_UNDERLINE*/;
cf2.underlineType = 1 /*_CFU_UNDERLINE*/;
mainForm.richedit.setSelCharformat(cf2)
}