Uz Galaxy - Info Archive top BBS   RSS
Info Archive  RichTextBox - リッチエディットボックスのフォントが勝手に変わるのを抑制  

    Private Const IMF_DUALFONT As Integer = &H80
    Private Const WM_USER As Integer = &H400
    Private Const EM_SETLANGOPTIONS As Integer = (WM_USER + 120)
    Private Const EM_GETLANGOPTIONS As Integer = (WM_USER + 121)

    <System.Runtime.InteropServices.DllImport("User32.dll", EntryPoint:="SendMessageA")> _
    Private Shared Function SendMessage( _
         ByVal hWnd As System.IntPtr, _
         ByVal wMsg As Integer, _
         ByVal wParam As Integer, _
         ByVal lParam As Integer _
        ) As Integer
    End Function

    Private Sub SetRichTextBoxNoAutoFontChange(ByVal RichTextBoxCtrl As RichTextBox)
        ' リッチエディットボックスのフォントが勝手に変わるのを抑制
        Dim lParam As Integer
        lParam = SendMessage(RichTextBoxCtrl.Handle, EM_GETLANGOPTIONS, 0, 0)
        lParam = lParam And (Not IMF_DUALFONT)
        SendMessage(RichTextBoxCtrl.Handle, EM_SETLANGOPTIONS, 0, lParam)
    End Sub


Copyright © 2004 Uz. All rights reserved.
http://uzgalaxy.com/
このページはInfoArchiveで作成されています。