首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

高分诚求 vb兑现记事本中的自动换行实现代码

2012-09-10 
高分诚求 vb实现记事本中的自动换行实现代码vb实现记事本中的自动换行实现代码,这要求和windows自带的记事

高分诚求 vb实现记事本中的自动换行实现代码
vb实现记事本中的自动换行实现代码,这要求和windows自带的记事本中,格式->自动换行的功能一模一样,(有对checkbox的那种),这是个老问题了,我看到网上并没有实质性的解决方案,望大神解救。

[解决办法]
TextBox不是有WordWrap属性吗,设定为True时就可以自动换行。
[解决办法]
试试,网上找到的内容:

SetRichTextBoxWordWrap - Set the WordWrap style of a RichTextBox control

VB code
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal _hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _lParam As Any) As LongPrivate Const WM_USER As Long = &H400Private Const EM_SETTARGETDEVICE As Long = WM_USER + 72' Enable/Disable the WordWrap style of a RichTextBox control'' Example:' Private Sub Check1_Click()' SetRichTextBoxWordWrap RichTextBox1, (Check1.Value = vbChecked)' End SubSub SetRichTextBoxWordWrap(ByVal ctlRichText As RichTextBox, _Optional ByVal bState As Boolean = True)SendMessage ctlRichText.hwnd, EM_SETTARGETDEVICE, 0, CLng(IIf(bState, 0, 1))End Sub 

热点排行