'/
'自定義訊息框上的按鈕的文字
'\\\\\\\\\\\\\\\\\\
'鬼龍之舞
'2004-3-1
'以下**在模組
option explicit
private declare function messagebox lib "user32" alias "messageboxa" (byval hwnd as long, byval lptext as string, byval lpcaption as string, byval wtype as long) as long
private declare function setdlgitemtext lib "user32" alias "setdlgitemtexta" (byval hdlg as long, byval niddlgitem as long, byval lpstring as string) as long
private declare function setwindowshookex lib "user32" alias "setwindowshookexa" (byval idhook as long, byval lpfn as long, byval hmod as long, byval dwthreadid as long) as long
private declare function unhookwindowshookex lib "user32" (byval hhook as long) as long
private const wh_cbt = 5
private const hcbt_activate = 5
private hhook as long
private function hookproc(byval ncode as long, byval wparam as long, byval lparam as long) as long
if ncode = hcbt_activate then
'hcbt_activate時wparam是將被啟用的視窗的控制代碼
dim hwnd as long
hwnd = wparam
'設定按鈕的文字
setdlgitemtext hwnd, vbok, byval "確定[&o]"
setdlgitemtext hwnd, vbcancel, byval "取消[&c]"
setdlgitemtext hwnd, vbyes, byval "是[&y]"
setdlgitemtext hwnd, vbno, byval "否[&n]"
setdlgitemtext hwnd, vbabort, byval "放棄[&a]"
setdlgitemtext hwnd, vbignore, byval "忽略[&i]"
setdlgitemtext hwnd, vbretry, byval "重試[&r]"
'不要再hook,以免帶來不必要的麻煩
unhookwindowshookex hhook
end if
hookproc = 0
end function
對話方塊上自定義繪製文字
以下 放置在onpaint 的else中,刪除原來else中的內容 文字 int itheight 200 文字高度 int itwidth 200 文字寬度 int ix 640 繪製區域的開始位置x int iy 150 繪製區域的開始位置y int icx ix itwidth 繪製區域的寬度...
自定義訊息
自定義訊息的響應和資源訊息的響應有很多類似之處 資源訊息的響應是以資源的id號作為標識的 自定義的訊息要自己宣告訊息id。一 定義 第一步要宣告訊息 definewm mymsgwm user 200 第二步要在類宣告中宣告訊息對映 declare message map 第三步要在類宣告中定義訊息...
Android 自定義按鈕
將按鈕的背景顏色設定成drawable檔案即可。雖然這裡講的是button,但是textview及其子元件也可以如法炮製 主布局檔案如下 下面三個檔案都放在drawable hdpi資料夾下,第乙個是my button selector.xml,定義了按鈕的不同狀態 my button presse...