富文本编辑框中下划线按钮实现

admin2021-10-28  932

	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)
	}
转载请注明原文地址: https://seopai.com/read-250.html
最新回复(0)
aardio问答
aardio编程语言