首 页IT知识库翔宇问吧收藏本站
当前位置:翔宇亭IT乐园IT知识库编程技术其它编程

在PB中制作特殊形状数据窗口和按钮

减小字体 增大字体 作者:LZP_LRP  来源:转载  发布时间:2010-05-18 09:22:00

event clicked;//////////////////////////////////////////////////

//                                                                         //

//                 测试用数据(窗口多边形)                    //

//                                                                         //

//////////////////////////////////////////////////



long ll_handle

ws_position lws_pointapi[]



// 图形2



int li_xpos, li_ypos, li_width, li_height

li_xpos = 12

li_ypos = 1

li_width = UnitsToPixels(parent.width, xunitstopixels!) - 32

li_height = UnitsToPixels(parent.height, yunitstopixels!) - 32



lws_pointapi[1].xpos = li_xpos

lws_pointapi[1].ypos = li_ypos + li_height / 3



lws_pointapi[2].xpos = li_xpos + li_width / 3

lws_pointapi[2].ypos = li_ypos



lws_pointapi[3].xpos = li_xpos + li_width * 2 / 3

lws_pointapi[3].ypos = li_ypos



lws_pointapi[4].xpos = li_xpos + li_width

lws_pointapi[4].ypos = li_ypos + li_height / 3



lws_pointapi[5].xpos = li_xpos + li_width

lws_pointapi[5].ypos = li_ypos + li_height * 2 / 3



lws_pointapi[6].xpos = li_xpos + li_width * 2 / 3

lws_pointapi[6].ypos = li_ypos + li_height



lws_pointapi[7].xpos = li_xpos + li_width / 3

lws_pointapi[7].ypos = li_ypos + li_height



lws_pointapi[8].xpos = li_xpos

lws_pointapi[8].ypos = li_ypos + li_height * 2 / 3



ll_handle = CreatePolygonRgn(lws_pointapi[], 8, 1)



//其中第 1 个参数为多边形各个顶点坐标值的数组

//其中第 2 个参数为多边形边数,可修改,配合数组值

//其中第 3 个参数为填充模式 ALTERNATE /WINDING



SetwindowRgn(handle(parent), ll_handle, true)



return 1

end event



type cb_5 from commandbutton within w_button

integer x = 1216

integer y = 940

integer width = 562

integer height = 148

integer taborder = 20

integer textsize = -12

integer weight = 700

fontcharset fontcharset = gb2312charset!

fontpitch fontpitch = variable!

string facename = "宋体"

string text = "还原窗口"

end type



event clicked;//////////////////////////////////////////////////

//                                                                         //

//                 测试用数据(窗口多边形)                    //

//                                                                         //

//////////////////////////////////////////////////



long ll_handle

ws_position lws_pointapi[]



// 图形2



int li_xpos, li_ypos, li_width, li_height

li_xpos = 1

li_ypos = 1

li_width = UnitsToPixels(parent.width, xunitstopixels!)

li_height = UnitsToPixels(parent.height, yunitstopixels!)



lws_pointapi[1].xpos = li_xpos

lws_pointapi[1].ypos = li_ypos



lws_pointapi[2].xpos = li_xpos + li_width

lws_pointapi[2].ypos = li_ypos



lws_pointapi[3].xpos = li_xpos + li_width

lws_pointapi[3].ypos = li_ypos + li_height



lws_pointapi[4].xpos = li_xpos

lws_pointapi[4].ypos = li_ypos + li_height





ll_handle = CreatePolygonRgn(lws_pointapi[], 4, 1)



//其中第 1 个参数为多边形各个顶点坐标值的数组

//其中第 2 个参数为多边形边数,可修改,配合数组值

//其中第 3 个参数为填充模式 ALTERNATE /WINDING



SetwindowRgn(handle(parent), ll_handle, true)



return 1

end event



type cb_4 from commandbutton within w_button

integer x = 585

integer y = 628

integer width = 562

integer height = 148

integer taborder = 30

integer textsize = -12

integer weight = 700

fontcharset fontcharset = gb2312charset!

fontpitch fontpitch = variable!

string facename = "宋体"

string text = "椭圆形窗口"

end type



event clicked;//////////////////////////////////////////////////

//                                                                         //

//                 测试用数据(窗口多边形)                    //

//                                                                         //

//////////////////////////////////////////////////



long ll_x1, ll_x2, ll_x3

long ll_y1, ll_y2, ll_y3

long ll_handle



parent.width = 2400

parent.height = 1800



ll_x1 = 10

ll_y1 = 25

ll_x2 = UnitsToPixels(parent.width, xunitstopixels!) - 10

ll_y2 = UnitsToPixels(parent.height, yunitstopixels!) - 10



ll_handle = CreateEllipticRgn(ll_x1, ll_y1, ll_x2, ll_y2)

SetwindowRgn(handle(parent), ll_handle, true)



return 1

end event



type cb_3 from commandbutton within w_button

integer x = 1216

integer y = 472

integer width = 562

integer height = 148

integer taborder = 20

integer textsize = -12

integer weight = 700

fontcharset fontcharset = gb2312charset!

fontpitch fontpitch = variable!

string facename = "宋体"

string text = "菱形窗口"

end type



event clicked;//////////////////////////////////////////////////

//                                                                         //

//                 测试用数据(窗口多边形)                    //

//                                                                         //

//////////////////////////////////////////////////



long ll_handle

ws_position lws_pointapi[]



// 图形2



int li_xpos, li_ypos, li_width, li_height

li_xpos = 1

li_ypos = 1

li_width = UnitsToPixels(parent.width, xunitstopixels!)

li_height = UnitsToPixels(parent.height, yunitstopixels!)



lws_pointapi[1].xpos = li_xpos

lws_pointapi[1].ypos = li_ypos + li_height / 2



lws_pointapi[2].xpos = li_xpos + li_width / 2

lws_pointapi[2].ypos = li_ypos



lws_pointapi[3].xpos = li_xpos + li_width

lws_pointapi[3].ypos = li_ypos + li_height / 2



lws_pointapi[4].xpos = li_xpos + li_width / 2

lws_pointapi[4].ypos = li_ypos + li_height





ll_handle = CreatePolygonRgn(lws_pointapi[], 4, 1)



//其中第 1 个参数为多边形各个顶点坐标值的数组

//其中第 2 个参数为多边形边数,可修改,配合数组值

//其中第 3 个参数为填充模式 ALTERNATE /WINDING



SetwindowRgn(handle(parent), ll_handle, true)



return 1

end event



type cb_2 from commandbutton within w_button

integer x = 585

integer y = 472

integer width = 562

integer height = 148

integer taborder = 20

integer textsize = -12

integer weight = 700

fontcharset fontcharset = gb2312charset!

fontpitch fontpitch = variable!

string facename = "宋体"

string text = "圆角矩形按钮"

end type



event clicked;this.enabled = false

of_set_oval(this)

end event



type cb_1 from commandbutton within w_button

integer x = 1216

integer y = 784

integer width = 562

integer height = 148

integer taborder = 10

integer textsize = -12

integer weight = 700

fontcharset fontcharset = gb2312charset!

fontpitch fontpitch = variable!

string facename = "宋体"

string text = "圆角矩形窗口"

end type



event clicked;//////////////////////////////////////////////////

//                                                                         //

//                 测试用数据(窗口多边形)                    //

//                                                                         //

//////////////////////////////////////////////////



long ll_x1, ll_x2, ll_x3

long ll_y1, ll_y2, ll_y3

long ll_handle



ll_x1 = 4

ll_y1 = 4

ll_x2 = UnitsToPixels(parent.width, xunitstopixels!) - 4

ll_y2 = UnitsToPixels(parent.height, yunitstopixels!) - 4

ll_x3 = 250

ll_y3 = 250



ll_handle = CreateRoundRectRgn(ll_x1, ll_y1, ll_x2, ll_y2, ll_x3, ll_y3)

SetwindowRgn(handle(parent), ll_handle, true)



return 1

end event



type st_1 from statictext within w_button

integer x = 567

integer y = 200

integer width = 1207

integer height = 264

boolean bringtotop = true

integer textsize = -8

integer weight = 400

fontcharset fontcharset = gb2312charset!

fontpitch fontpitch = variable!

string facename = "宋体"

long textcolor = 33554432

long backcolor = 17725690

alignment alignment = center!

boolean focusrectangle = false

end type



event clicked;if this.width <= 1000 then

     this.resize(1586, 2164)

else

     this.resize(986, 264)

end if

end event

翔宇亭IT乐园提醒您:本文来自于互联网,版权归原作者和各发布网站所有,本站收集这些文章仅供学习参考之用。任何人都不能将这些文章用于商业或者其他目的。(www.biye5u.com)

上一页  [1] [2] [3] 

知识评论评论内容只代表网友观点,与本站立场无关!

   评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论

用户名: 查看更多评论

分 值:100分 85分 70分 55分 40分 25分 10分 1分

内 容:

            请注意用语文明且合法,不要发布带有攻击性、侮辱性的言论,谢谢合作!

         通知管理员 验证码:

关于本站 | 网站帮助 | 广告合作 | 网站声明 | 友情连接 | 网站地图 | 用户守则 | 联系我们 |
本站大多数内容来自互联网或网站会员发布,如有侵权,请来信告之,谢谢!
Copyright © 2007-2017 biye5u.com. All Rights Reserved.
网站备案号:黑ICP备13005378号-3