TTF文件,如何让程序自动注册字体呢?
解决方案 »
- 基于Com/ActiveX图形控件在VB中使用免费使用 http://one.fsphost.com/sofish 下载,欢迎技术交流!
- MSHFLEXGRID空件的问题。跪求高手指点。
- 初学网络编程,几个小问题关于stock控件下的tcp传输
- 请问:我刚从网上下载了vb的msdn,不知道如何能启动使用它?
- comboBox与数据库字段??
- 如何得到outlook express和outlook(office)的通信簿的具体内容?
- 空字段问题
- 大家好!
- 如何设置MSFlexGrid控件中的DataSource属性
- 控件数组是怎样响应事件的?
- vb 内存溢出 是timer么
- 请问几个SPREAD控件的使用
网上也搜到这个代码了,复制过去不行http://topic.csdn.net/t/20030821/18/2174211.html 三楼就是这个
另外,怎么复制呢? 直接filecopy 不能复制ttf文件
Public Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFileName As String) As Long
Private Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFileName As String) As Long
Private Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFileName As String) As Long
Dim AppPath As String
Private Sub Form_Load()
'The KPD-Team 2001
'URL: http://www.allapi.net/
'E-Mail: [email protected]
AppPath = App.Path
If Right$(AppPath, 1) <> "\" Then AppPath = AppPath + "\"
'Add the font to the Windows Font Table
AddFontResource AppPath + "myfont.ttf"
'Write something on the form
Me.AutoRedraw = True
Me.FontName = "myfont"
Me.Print "This is a test!"
End Sub
Private Sub Form_Unload(Cancel As Integer)
'Remove the font from the Windows Font Table
RemoveFontResource AppPath + "myfont.ttf"
End Sub