pb中如何动态创建菜单?

jqka007 2003-08-19 02:17:47
在pb中,想通过查询数据库的相关记录动态创建菜单,应该如何实现,请高手指点
...全文
73 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
PB 编程技巧100例(CHM) Table (20)PB修改数据库表结构的技巧 李清 System (19)用PB5设计串口通讯程序 王学军 TreeView (18)在PB的TreeView控件实现自动查询 周剑峰 Datawindow (17)PowerBuilder数据窗口编程技巧十则 蔡伟龙 System (16)如何在POWER BUILDER使用WINSOCK控件 达伟春 OTHER (15)在PB打印实现人民币大写 侯晓伟 MENU (14)用PB做一个通用右键菜单 田俊国 SQL (13)SQL基础 System (12)用PowerBuilder开发多媒体播放器 河北 黄万璞 控件 (11)动态创建可视控件的基本方法 鹿寒 WEB (10) 用PowerBuilder创建Internet应用 Sybase 软件(北京)有限公司 霍军 SQL (9)同时访问多个数据库 大庆石化总厂信息心 (邮编163714) 李畅 System (8)如何在PB使用OCX控件? 陶清网站 Datawindow (7)美化DataWindow的显示效果 程序PB站 Datawindow (6)当Retrieve时不清除原有Datawindow数据 程序PB站 Datawindow (5)当表(Table)的定义发生改变以后同步DataWindow columns 程序PB站 Datawindow (4)在表格(Grid)风格的DataWindow放入标题 程序PB站 Datawindow (3)使用Line建立漂亮的Grid DataWindow的技巧 程序PB站 System (2)使Sybase SQL Anywhere的启动窗口不出现在任务栏 程序PB站 SQL (1)使用SQL产生BCP命令快速备份/恢复你所有数据 (仅用于Sybase和MS SQL Server数据库) 程序PB

1,077

社区成员

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

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