请教动态添加菜单的问题
cwel 2017-10-27 06:39:18 如下代码添加一级菜单没问题:
menu m_temp
integer li_count
m_temp = create m_new
li_count = upperbound(m_genapp_main.item[])
m_genapp_main.item[li_count + 1] = m_temp
m_genapp_main.item[li_count + 1].text = "新菜单"
m_genapp_main.item[li_count + 1].tag = "001"
m_genapp_main.item[1].hide()
m_genapp_main.item[1].show()
destroy m_temp
在此基础上,再添加一个二级菜单,pb就崩了,什么问题?
menu m_temp
integer li_count,li_count1
m_temp = create m_new
li_count = upperbound(m_genapp_main.item[])
m_genapp_main.item[li_count + 1] = m_temp
m_genapp_main.item[li_count + 1].text = "新菜单"
m_genapp_main.item[li_count + 1].tag = "001"
li_count1 = upperbound(m_genapp_main.item[li_count+1].item[])
m_genapp_main.item[li_count+1].item[li_count1+1] = m_temp
m_genapp_main.item[li_count+1].item[li_count1+1].text = "新菜单1"
m_genapp_main.item[li_count+1].item[li_count1+1].tag = "0001"
m_genapp_main.item[1].hide()
m_genapp_main.item[1].show()
destroy m_temp
谢谢帮助!!!