pb中如何动态创建菜单?

jqka007 2003-08-19 02:17:47
在pb中,想通过查询数据库的相关记录动态创建菜单,应该如何实现,请高手指点
...全文
66 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
chrisfy 2003-08-19
  • 打赏
  • 举报
回复
看看已有菜单的Edit source
pb动态创建树和菜单 forward global type w_tv from window end type type cb_2 from commandbutton within w_tv end type type cb_1 from commandbutton within w_tv end type type sle_1 from singlelineedit within w_tv end type type st_1 from statictext within w_tv end type end forward global type w_tv from window integer width = 1381 integer height = 620 boolean titlebar = true string title = "Untitled" boolean controlmenu = true windowtype windowtype = response! long backcolor = 67108864 string icon = "AppIcon!" boolean center = true cb_2 cb_2 cb_1 cb_1 sle_1 sle_1 st_1 st_1 end type global w_tv w_tv on w_tv.create this.cb_2=create cb_2 this.cb_1=create cb_1 this.sle_1=create sle_1 this.st_1=create st_1 this.Control[]={this.cb_2,& this.cb_1,& this.sle_1,& this.st_1} end on on w_tv.destroy destroy(this.cb_2) destroy(this.cb_1) destroy(this.sle_1) destroy(this.st_1) end on event open;String ls_Parm, ls_temp, ls_Name, ls_title ls_Parm = Trim( Message.StringParm ) ls_temp = Right( ls_Parm, 1 ) ls_Name = Left( ls_Parm, Lenw( ls_Parm ) - 2 ) IF ls_temp = 'T' THEN ls_title = '添加 ' + ls_Name + ' 的同类' END IF IF ls_temp = 'Z' THEN ls_title = '添加 ' + ls_Name + ' 的子类' END IF IF ls_temp = 'M' THEN ls_title = '修改 ' Sle_1.text = ls_Name Sle_1.SelectText( 1, Len( ls_Name ) ) END IF title = ls_title end event type cb_2 from commandbutton within w_tv integer x = 727 integer y = 360 integer width = 457 integer height = 128 integer taborder = 20 integer textsize = -12 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" string text = "退出(&E)" boolean cancel = true end type event clicked;CloseWithReturn( Parent, '' ) end event type cb_1 from commandbutton within w_tv integer x = 165 integer y = 360 integer width = 457 integer height = 128 integer taborder = 30 integer textsize = -12 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" string text = "确定(&O)" boolean default = true end type event clicked;String ls_Name ls_Name = Trim( sle_1.text ) CloseWithReturn( Parent, ls_Name ) end event type sle_1 from singlelineedit within w_tv integer x = 64 integer y = 156 integer width = 1234 integer height = 128 integer taborder = 10 integer textsize = -12 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 borderstyle borderstyle = stylelowered! end type type st_1 from statictext within w_tv integer x = 64 integer y = 40 integer width = 457 integer height = 72 integer textsize = -12 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 long backcolor = 67108864 string text = "类别名称" boolean focusrectangle = false end type

1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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