PB中轻松实现真正意义上的大字体工具栏
来源:互联网 发布:腾讯云备案域名 编辑:程序博客网 时间:2024/04/29 19:09
将以下代码保存为:uo_toolbarfont.sru文件,再在PB中导入,按照constructor()事件中的说明写上两行代码就可以轻松实现真正意义上的大字体工具栏.
请注意在PB11中的不同.
forward
global type uo_toolbarfont from nonvisualobject
end type
end forward
global type uo_toolbarfont from nonvisualobject
end type
global uo_toolbarfont uo_toolbarfont
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
- PB中轻松实现真正意义上的大字体工具栏
- 实现真正意义上的文件类型判断
- 各大企业将如何实现真正意义上的融合?
- PB中实现带工具栏的Popup窗口
- 真正意义上的一次实现,记录一下~
- PB中利用字体实现EAN13条形码的打印
- 揭秘大数据交易的真正意义
- 真正意义上的产品经理
- 一种真正意义上的Session劫持
- 一种真正意义上的Session劫持
- 这才是真正意义上的“扶手”
- 真正意义上的“随机”---c语言
- csdn真正意义上的第一天
- 真正意义上的响应式表格
- 真正意义上的编程第一天
- 真正意义上的前端开发
- 白盒测试中如何实现真正意义上并发测试(Java)
- 第一次真正意义上的用VC++实现的一个完整的Win32程序—俄罗斯方块
- js 判断此文件是否有此id属性的控件
- javascript实现的树型下拉框
- 感想
- PL/SQL中怎样使用动态游标
- COGNOS8安装
- PB中轻松实现真正意义上的大字体工具栏
- C#使用Ajax技术叫用后台逻辑代码
- How to make conversion between RGB and HSV? [Python sourcecode]
- 通用存储过程——节省你的时间,延长程序员的寿命!
- 关于博客的开通
- ORACLE中使用动态游标的例子
- 设计领域,数据表和对象的关系。
- 浏览器百家争鸣 上网冲浪装备如何选?
- Page.RegisterClientScriptBlock(string, string)已过时:和page.RegisterStartupScript已过时:解决办法