RichTextBoxのIMF_DUALFONTとIMF_AUTOFONTフラグをクリアする。デフォルトでオンになっている。
1 2 3 4 |
uint lParam; lParam = SendMessage(richTextBoxMessage.Handle, EM_GETLANGOPTIONS, 0, 0); lParam &= ~(IMF_DUALFONT | IMF_AUTOFONT); SendMessage(richTextBoxMessage.Handle, EM_SETLANGOPTIONS, 0, lParam); |
1 2 3 4 5 6 7 |
private const uint IMF_AUTOFONT = 0x02; private const uint IMF_DUALFONT = 0x80; private const uint WM_USER = 0x0400; private const uint EM_SETLANGOPTIONS = WM_USER + 120; private const uint EM_GETLANGOPTIONS = WM_USER + 121; [System.Runtime.InteropServices.DllImport("USER32.dll")] private static extern uint SendMessage(System.IntPtr hWnd, uint msg, uint wParam, uint lParam); |
参考:http://pineplanter.moo.jp/non-it-salaryman/2017/11/25/post-5255/