菜单问题
我在菜单项中设置字体一项,用来改变文本框的字体,可是运行后什么
都没有,程序如下:
Private Sub Font_Click()
CommonDialog1.Flags = cdlCFBoth
CommonDialog1.ShowFont
Text1.Font.Name = CommonDialog1.FontName
Text1.Font.Bold = CommonDialog1.FontBold
Text1.Font.Size = CommonDialog1.FontSize
Text1.Font.Italic = CommonDialog1.FontItalic
End Sub
但是我用一个命令按钮用同样的代码却可以调出字体设置的对话框,一样的程序啊?
Private Sub Command3_Click()
CommonDialog1.Flags = cdlCFBoth
CommonDialog1.ShowFont
Text1.Font.Name = CommonDialog1.FontName
Text1.Font.Bold = CommonDialog1.FontBold
Text1.Font.Size = CommonDialog1.FontSize
Text1.Font.Italic = CommonDialog1.FontItalic
End Sub
请问这是为什么啊?
谢谢!