改变PB自带工具栏的字体﹐不要自定义控件做工具栏。
function long FN_ToolBarSetFont(long unknown,string fontname,long fontsize,long unknown1,string str) library "pbvm100.dll"
用这个方法可以改
声明
function long FindWindowExA( long hParent, long hChildAfter, String lpszClass, String lpszWindow ) Library "user32.dll"
function long GetWindowLongA( long hWnd, integer index) Library "user32.dll"
function long FN_ToolBarSetFont(long unknown,string fontname,long fontsize,long unknown1,string str) library "pbvm80.dll"
修改代码
long ll_null, ll_hwndToolBar, ll_hwnd, ll_pToolbar
string ls_windowName
SetNull(ls_windowName)
SetNull(ll_null)
try
ll_hwnd = Handle(awin)
ll_hwndToolBar = FindWindowEXA(ll_hwnd, ll_NULL, IS_TOOLBARCLASSNAME, ls_WindowName )
if ll_hwndToolBar > 0 then
ll_pToolbar = GetWindowLongA(ll_hwndToolBar,0)
FN_ToolBarSetFont(ll_pToolbar, aFontName, aFontSize, 0, space(aTextSize))
end if
catch(throwable ex)
SignalError(-1, "Call API function to set toolbar font failed.")
return -1
end try
如果是pb9的话IS_TOOLBARCLASSNAME = "FNFIXEDBAR90"