请教:toolbar里的item的大小如何调整

mummyII 2011-09-12 07:45:58
系统给的太小了。
...全文
280 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
北京大丸子 2014-02-22
  • 打赏
  • 举报
回复
引用 4 楼 wag_enu 的回复:
在PB12 上定义的工具栏图标就比较大个。
你好,请问pb12能设置toolbar字体大小吗?起码比pb11的要大就行,pb11太小了
mummyII 2011-09-13
  • 打赏
  • 举报
回复
不会玩,我用记事本保存了这个文件--uo_toolbarfont.sru
导入pbl的时候看不到它
yyoinge 2011-09-13
  • 打赏
  • 举报
回复
sru指的是文件的后缀名
你随便导出一个自定义对象就晓得了
mummyII 2011-09-13
  • 打赏
  • 举报
回复
sru是什么?
yyoinge 2011-09-13
  • 打赏
  • 举报
回复
以下内容保存为uo_toolbarfont.sru
然后导入pbl中,在mdi主窗口的open事件中加上以下语句:
uo_toolbarfont luo_toolbarfont
luo_toolbarfont.of_settoolbarfont( this, '宋体', -12, '中1')//-12表示字体大小


$PBExportHeader$uo_toolbarfont.sru
forward
global type uo_toolbarfont from nonvisualobject
end type
end forward

global type uo_toolbarfont from nonvisualobject autoinstantiate
end type

type prototypes
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 "pbvm90.dll"

end prototypes

type variables

end variables

forward prototypes
public function integer of_gettoolbarhandle (window aw_frame)
public subroutine of_settoolbarfont (window aw_frame, string as_fontname, integer ai_fontsize, string as_extent)
end prototypes

public function integer of_gettoolbarhandle (window aw_frame);long ll_NULL, ll_hwndToolBar
string ls_ClassName, ls_WindowName
Environment lEnv

IF IsValid( aw_Frame ) AND (GetEnvironment(lEnv) = 1) THEN
CHOOSE CASE lEnv.PBMajorRevision
CASE 6
ls_ClassName = "FNFIXEDBAR60"
case 7
ls_ClassName = "FNFIXEDBAR70"
case 8
ls_ClassName = "FNFIXEDBAR80"
case 9
ls_ClassName = "FNFIXEDBAR90"
case 11
ls_ClassName = "FNFIXEDBAR110"
END CHOOSE
SetNull(ls_WindowName)
SetNull(ll_NULL)
ll_hwndToolBar = FindWindowEXA( Handle(aw_Frame), ll_NULL, ls_ClassName, ls_WindowName )
END IF

RETURN ll_hwndToolBar

end function

public subroutine of_settoolbarfont (window aw_frame, string as_fontname, integer ai_fontsize, string as_extent);long ll_hwndToolBar,ll_unknown
ll_hwndToolBar = of_GetToolBarHandle( aw_frame)
if ll_hwndToolBar>0 then
ll_unknown = GetWindowLongA(ll_hwndToolBar,0)
//ll_unknown = GetWindowLongA(ll_hwndToolBar,-21)//PB11用
FN_ToolBarSetFont(ll_unknown,as_fontname,ai_fontsize,0,as_extent)
end if

end subroutine

on uo_toolbarfont.create
call super::create
TriggerEvent( this, "constructor" )
end on

on uo_toolbarfont.destroy
TriggerEvent( this, "destructor" )
call super::destroy
end on

event constructor;/*
在MDI窗口的窗口变量声明中声明
//大字体工具栏
uo_toolbarfont iuo_toolbarfont
在open事件中调用:
iuo_toolbarfont.of_settoolbarfont (this,'宋体',-12,"1234567")
*/
end event

mummyII 2011-09-13
  • 打赏
  • 举报
回复
似乎没起作用
mummyII 2011-09-13
  • 打赏
  • 举报
回复
恩,搞定了,这个重来没用过
mummyII 2011-09-12
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 wag_enu 的回复:]
什么版本的PB ?
[/Quote]
9
wag_enu 2011-09-12
  • 打赏
  • 举报
回复
在PB12 上定义的工具栏图标就比较大个。
wag_enu 2011-09-12
  • 打赏
  • 举报
回复
什么版本的PB ?
lightsword1 2011-09-12
  • 打赏
  • 举报
回复
这个不能直接调整它的大小.
可以参考一下这个
http://download.csdn.net/detail/xys_777/2233701

604

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 控件与界面
社区管理员
  • 控件与界面社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧