在vb怎样解决用commondialog设定字体设计时弹出没有安装字体的问题
在调式的时候弹出字体对话框,说没有安装字体,请从控制面板
打开“字体”文件夹以便安装字体!请问怎么才能解决字体安装问题?
C:\WINDOWS\Fonts里面打开看了也有好多字体类型
我那段代码是这样的,不知道是对的不,请各位多多指教....(我是在PICTUREBOX上直接加了个TXT)
Private Sub Command7_Click()
CommonDialog1.ShowFont
Picture1.Font = CommonDialog1.FontName
End Sub还有就是 如果我想改变字体的颜色又应该怎么办呢?
下面这段是改变画出的图形的颜色
Private Sub Command1_Click()
CommonDialog1.ShowColor
Picture1.ForeColor = CommonDialog1.Color
End Sub
在调式的时候弹出字体对话框,说没有安装字体,请从控制面板
打开“字体”文件夹以便安装字体!请问怎么才能解决字体安装问题?
C:\WINDOWS\Fonts里面打开看了也有好多字体类型
我那段代码是这样的,不知道是对的不,请各位多多指教....(我是在PICTUREBOX上直接加了个TXT)
Private Sub Command7_Click()
CommonDialog1.ShowFont
Picture1.Font = CommonDialog1.FontName
End Sub还有就是 如果我想改变字体的颜色又应该怎么办呢?
下面这段是改变画出的图形的颜色
Private Sub Command1_Click()
CommonDialog1.ShowColor
Picture1.ForeColor = CommonDialog1.Color
End Sub
解决方案 »
- 刚有一本VB的新书出版了,好像不错的样子
- !!!!!winsock的udp方式能否同时实现多连接呐
- 如何定义主键!
- 十万火急!!!20分求答案!!!
- 提问关于vb读取xml文件的问题
- 手把手教我一下(关于activeskin)菜鸟也想让程序界面美化
- 我想把新生成的文件保存到主程序的安装目录内?急
- 因为http://www.csdn.net/expert/topic/502/502827.shtm,所以给AdamBear(学习再学习)300分,AdamBear请进。
- microsoft Visual Basic6.0装入后出错了!??!!!
- 新手请教
- CallByName与ScriptControl控件在调用function中的应用
- VB qq消息监控
Option Explicit
Dim c As Long
Dim red As Byte
Dim green As Byte
Dim blue As Byte
Private Sub Command1_Click()
CommonDialog1.CancelError = True
CommonDialog1.DialogTitle = "颜色"
CommonDialog1.ShowColor
c = CommonDialog1.Color
red = (c And &HFF)
green = (c And 62580) / 256
blue = (c And &HFF00) / 65536
Picture1.FontSize = 36
Picture1.ForeColor = RGB(red, green, blue)
Picture1.Print "Color"
End Sub
Dim c As Long
Dim red As Byte
Dim green As Byte
Dim blue As Byte
Private Sub Command1_Click()
CommonDialog1.CancelError = True
CommonDialog1.DialogTitle = "颜色"
CommonDialog1.ShowColor
c = CommonDialog1.Color
red = (c Mod 65536) Mod 256 'Red
green = (c Mod 65536) \ 256 'Green
blue = c \ 65536 'Blue
Picture1.FontSize = 36
Picture1.ForeColor = RGB(red, green, blue)
Picture1.Print "Color"
End Sub
Dim c As Long
Dim red As Byte
Dim green As Byte
Dim blue As Byte
Private Sub Command1_Click()
CommonDialog1.CancelError = True
CommonDialog1.DialogTitle = "颜色"
CommonDialog1.ShowColor
c = CommonDialog1.Color
red = (c Mod 65536) Mod 256 'Red
green = (c Mod 65536) \ 256 'Green
blue = c \ 65536 'Blue
FontXz
Picture1.ForeColor = RGB(red, green, blue)
Picture1.Print "Color"
End SubPrivate Sub FontXz()
' 设置“取消”为 True
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
' 设置 Flags 属性
CommonDialog1.Flags = cdlCFEffects Or cdlCFBoth
' 显示“字体”对话框
CommonDialog1.ShowFont
Picture1.Font.Name = CommonDialog1.FontName
Picture1.Font.Size = CommonDialog1.FontSize
Picture1.Font.Bold = CommonDialog1.FontBold
Picture1.Font.Italic = CommonDialog1.FontItalic
Picture1.Font.Underline = CommonDialog1.FontUnderline
Picture1.FontStrikethru = CommonDialog1.FontStrikethru
Picture1.ForeColor = CommonDialog1.Color
Exit Sub
ErrHandler:
' 用户按了“取消”按钮
Exit Sub
End Sub