English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
所有分類

如題
希望能把Msgbox顯示出來的文字變大,請問要怎麼作?

2006-12-21 11:37:12 · 2 個解答 · 發問者 孝武 2 in 電腦與網際網路 程式設計

感謝W.J.S. 的回答可以使用,謝謝.

2006-12-22 04:02:21 · update #1

2 個解答


'版本VB6.0
'※以下的Code放在模組內(Module1)
Declare Sub SendMessage Lib "user32" Alias "SendMessageA" (ByVal H&, ByVal M&, ByVal W&, P&)
Declare Function FindWindow& Lib "user32" Alias "FindWindowA" (ByVal C$, ByVal W$)
Declare Function CreateFont& Lib "gdi32" Alias "CreateFontA" (ByVal H&, ByVal W&, ByVal E&, ByVal O&, ByVal fW&, ByVal It As Boolean, ByVal Ul As Boolean, ByVal SO As Boolean, ByVal C&, ByVal P&, ByVal n&, ByVal q&, ByVal M&, ByVal Z$)
Declare Function FindWindowEx& Lib "user32" Alias "FindWindowExA" (ByVal H&, ByVal H2&, ByVal S$, ByVal S2$)
Declare Sub SetTimer Lib "user32" (ByVal H&, ByVal n&, ByVal E&, ByVal T&)
Declare Sub KillTimer Lib "user32" (ByVal H&, ByVal I&)

Public Sub TP(ByVal H&, ByVal M&, ByVal I&, ByVal T&)
Dim W&, F&, X&

'按鈕字大小改成22,字型改成標楷體
F = CreateFont(22, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 0, 0, "標楷體")
X = FindWindow("#32770", "知識+")
W = FindWindowEx(X, 0, "Button", "確定") '改按鈕字型
SendMessage W, &H30, F, 0
'顯示大小改成16,字型改成細明體(斜體)
F = CreateFont(16, 0, 0, 0, 0, True, 0, 0, 136, 0, 0, 0, 0, "細明體")
W = FindWindowEx(X, 0, "Static", "改變字型") '改顯示字型
SendMessage W, &H30, F, 0
KillTimer H, I
End Sub
'---------------------------
'※以下的Code放在表單(Form1)
Private Sub Command1_Click()
SetTimer hwnd, &H5000&, 1, AddressOf TP
MsgBox "改變字型", , "知識+"
End Sub

2006-12-21 21:04:29 · answer #1 · answered by W.J.S. 7 · 0 0

好像沒法改~~
自己做一個比較快~~
就是在開一個新的表單~~
在自己啦出確認跟取消button
然後設定一個public 變數給當他的回傳值

2006-12-21 20:54:57 · answer #2 · answered by Sing 3 · 0 0

fedest.com, questions and answers