View Full Version : Font tieng Viet
huonglan
09-08-2002, 09:11
Có bạn nào chỉ dùm cách đổi font hệ thống để đánh tiếng việt trên tiêu đề của form trong visual basic và visual fox không?
Cảm ơn trước nhe!
chon properties ở màn hình bằng cách nhấn chuột phải vào màn hình, chọn tab appearance, chọn vào title bar chỉnh font việt ở mục font, nhấn apply, ok. Nhớ là font nào thì gõ theo bảng mã ấy.
Gui Mail cho minh tai dia chi quatban@hotmail.com, minh se gui cho 1 doan ma nguon lam chuyen do(Tu dong setfont he thong khi chay chuong trinh)
CayTreGia
07-10-2002, 18:43
sao bạn không add code đó lên mạng luôn cho mọi người cùng học hỏi mà phải viết thư riêng vậy?
cách của nnh nông dân wé.
Hãy đến đây www.vb4u.dk3.com
c ya !!!
White_Rose
08-10-2002, 00:32
Sử dụng hàm SystemParametersInfo
CayTreGia
11-10-2002, 20:55
Bạn có thể cho mình một ví dụ cụ thể được không?
cám ơn
huonglan
15-10-2002, 17:14
Hi White_Rose !
Bạn có thể cho một ví dụ của ham SystemParametersInfo
White_Rose
21-10-2002, 22:05
Private Type LOGFONT
lfHeight As Long
lfWidth As Long
lfEscapement As Long
lfOrientation As Long
lfWeight As Long
lfItalic As Byte
lfUnderline As Byte
lfStrikeOut As Byte
lfCharSet As Byte
lfOutPrecision As Byte
lfClipPrecision As Byte
lfQuality As Byte
lfPitchAndFamily As Byte
lfFaceName(1 To 32) As Byte
End Type
Private Type NONCLIENTMETRICS
cbSize As Long
iBorderWidth As Long
iScrollWidth As Long
iScrollHeight As Long
iCaptionWidth As Long
iCaptionHeight As Long
lfCaptionFont As LOGFONT
iSMCaptionWidth As Long
iSMCaptionHeight As Long
lfSMCaptionFont As LOGFONT
iMenuWidth As Long
iMenuHeight As Long
lfMenuFont As LOGFONT
lfStatusFont As LOGFONT
lfMessageFont As LOGFONT
End Type
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" _
(ByVal uAction As Long, ByVal uParam As Long, lpvParam As NONCLIENTMETRICS, _
ByVal fuWinIni As Long) As Long
Sub ChangeTitleFont(fontname As String)
Dim ncm As NONCLIENTMETRICS, oldncm As NONCLIENTMETRICS
Dim i As Long
'Lấy thông tin về font hiện tại
ncm.cbSize = Len(ncm)
i = SystemParametersInfo(41, 0, ncm, 0)
'Lưu giữ font cũ và tạo thông tin về font mới
oldncm = ncm
For i = 1 To Len(fontname)
ncm.lfMessageFont.lfFaceName(i) = Asc(Mid(fontname, i, 1))
ncm.lfCaptionFont.lfFaceName(i) = Asc(Mid(fontname, i, 1))
Next
ncm.lfMessageFont.lfFaceName(i) = 0
ncm.lfCaptionFont.lfFaceName(i) = 0
'Thiết lập font mới
i = SystemParametersInfo(42, 0, ncm, &H1 Or &H2)
MsgBox "Setting new font is completed!"
'Trả lại font ban đầu
i = SystemParametersInfo(42, 0, oldcm, &H1 Or &H2)
MsgBox "Example is completed!"
End Sub
Chi tiết hơn
http://207.150.221.94/ws-ihatelov/vbasp/vbasp.asp?cat=1&sec=3&topic=8&id=336
Powered by vBulletin® Version 4.2.0 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.