# 可以Undo，但仅能Undo最近一次的设定

Posted by cww on December 24, 1998 at 08:36:57:

In Reply to: 请问cww关于改变RichTextBox的字型 posted by jason on December 23, 1998 at 15:44:02:

Private Sub Command1_Click()
CommonDialog1.Flags = cdlCFEffects Or cdlCFBoth ' 显示「字型」对话方块
CommonDialog1.ShowFont
RichTextBox1.SelFontSize = CommonDialog1.FontSize
RichTextBox1.SelFontName = CommonDialog1.FontName
End Sub

Private Sub Command2_Click()
Dim i As Long
i = SendMessage(RichTextBox1.hwnd, EM_UNDO, 0, 0)
End Sub

以上面的例子来说，只会undo SelFontName的设定而
SelFontSize则不受影响，原因很清楚吧

Follow Ups:

- Re: 可以Undo，但仅能Undo最近一次的设定 jason 11:05:24 12/24/98 (0)