虎扑里的jr是什么意思:将RichTextBox设置为自动换行
来源:百度文库 编辑:中财网 时间:2024/04/29 16:39:07
日研究文本控件和字符串,研究得头混脑胀,问题真是太多了。
这只是其中的一个问题,答案来自问专家网站和CSDN的,解决如下:
Public Const WM_USER = &H400
Public Const EM_SETTARGETDEVICE = (WM_USER + 72)
Public Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Public Sub AutoSwitchLine(ByRef RichText As Long, ByVal bSwitch As Boolean)
If bSwitch Then
´设置 RichTextBox 自动换行
Call SendMessage(RichText.hWnd, EM_SETTARGETDEVICE, _
GetDC(RichText.hWnd), RichText.Width / 15)
If RichText.RightMargin = 0 Then
RichText.RightMargin = 1
Else
RichText.RightMargin = 0
End If
Else
´设置 RichTextBox 不自动换行
Call SendMessage(RichText.hWnd, EM_SETTARGETDEVICE, 0, 1)
End If
End Sub
这只是其中的一个问题,答案来自问专家网站和CSDN的,解决如下:
Public Const WM_USER = &H400
Public Const EM_SETTARGETDEVICE = (WM_USER + 72)
Public Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Public Sub AutoSwitchLine(ByRef RichText As Long, ByVal bSwitch As Boolean)
If bSwitch Then
´设置 RichTextBox 自动换行
Call SendMessage(RichText.hWnd, EM_SETTARGETDEVICE, _
GetDC(RichText.hWnd), RichText.Width / 15)
If RichText.RightMargin = 0 Then
RichText.RightMargin = 1
Else
RichText.RightMargin = 0
End If
Else
´设置 RichTextBox 不自动换行
Call SendMessage(RichText.hWnd, EM_SETTARGETDEVICE, 0, 1)
End If
End Sub
word哪里设置自动换行?
如何设置表格自动换行?
word/excel自动将换行符转化为两个空格
如何将光驱设置为自动运行??
Visual chm可不可以设置自动换行?
excel里面如何设置打印自动换行
如何在photoshop中设置自动换行
自动换行
自动换行
如何将电脑的光盘设置为“自动播放”
如何将金山毒霸设置为开机自动运行
如何将电脑设置为开机自动上网?谢谢
在EXCEL的单元格中想换行除了将表格属性改成自动换行外还有什么方法自如换行?
word 中如何将自动换行符转换成手动换行符?
dreamweaver~表格中的文本能不能自动换行?怎样设置?
请问怎么禁用Dreamweaver8的自动换行?在哪里设置?
请问如何禁用Dreamweaver8的自动换行?在哪里设置?
请问XP系统下怎样设置让记事本自动换行?
html自动换行?
asp实现自动换行
如何取消自动换行
没有了自动换行
如何自动换行
Excel2003单元格自动换行