on preload -- -- Check to see if the selection changed message was fired. -- result = Dialog.Input("输入数据", "您的回答:", "", MB_ICONQUESTION); if (e_MsgID == MSGID_ONSELCHANGED) then -- Check to see if the selection change was fired by the CTRL_COMBOBOX_01 control. if (e_CtrlID == CTRL_COMBOBOX_01) then -- Remove all items from the CTRL_COMBOBOX_02 control. DlgComboBox.RemoveItem(CTRL_COMBOBOX_02, -1); -- Check if "Item A" was selected in the first combo box. if (e_Details.Text == "船舶事业部") then -- result = Dialog.Message("注意", "在这里输入信息。", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); -- Add two items to the second combo box control related to "Item A" DlgComboBox.AddItem(CTRL_COMBOBOX_02, "深圳陆地"); DlgComboBox.AddItem(CTRL_COMBOBOX_02, "Item A Secondary Two"); -- Set selected state of the second combo box to the first item in the list. DlgComboBox.SetProperties(CTRL_COMBOBOX_02, {Selected=1}); -- Check if "Item B" was selected in the first combo box. elseif (e_Details.Text == "Item B") then -- Add two items to the second combo box control related to "Item B". DlgComboBox.AddItem(CTRL_COMBOBOX_02, "Item B Secondary One"); DlgComboBox.AddItem(CTRL_COMBOBOX_02, "Item B Secondary Two"); -- Set selected state of the second combo box to the first item in the list. DlgComboBox.SetProperties(CTRL_COMBOBOX_02, {Selected=1}); -- Check if "Item C" was selected in the first combo box. elseif (e_Details.Text == "Item C") then -- Add two items to the second combo box control related to "Item C". DlgComboBox.AddItem(CTRL_COMBOBOX_02, "Item C Secondary One"); DlgComboBox.AddItem(CTRL_COMBOBOX_02, "Item C Secondary Two"); -- Set selected state of the second combo box to the first item in the list. DlgComboBox.SetProperties(CTRL_COMBOBOX_02, {Selected=1}); else -- Do nothing. end end end on next -- 这些操作在点击“下一步”按钮时执行。 -- 提示:你可以在这里添加验证用户输入信息的操作 strCTRL_COMBOBOX_01_TXT = DlgComboBox.GetProperties(CTRL_COMBOBOX_01).Text; strCTRL_COMBOBOX_02_TXT = DlgComboBox.GetProperties(CTRL_COMBOBOX_02).Text; -- Check to see if the selection change was fired by the CTRL_COMBOBOX_01 control. ----------------根据用户选择的事业部和船舶名称,确定与之对应的数据库表明 if (strCTRL_COMBOBOX_02_TXT == "南海二号") then str_info_tb_name="zj_info_3"; str_input_tb_name="zj_input_3"; str_output_tb_name="zj_output_3"; -- Check if "Item B" was selected in the first combo box. elseif (strCTRL_COMBOBOX_02_TXT == "Item B") then -- Add two items to the second combo box control related to "Item B". DlgComboBox.AddItem(CTRL_COMBOBOX_02, "Item B Secondary One"); DlgComboBox.AddItem(CTRL_COMBOBOX_02, "Item B Secondary Two"); -- Set selected state of the second combo box to the first item in the list. DlgComboBox.SetProperties(CTRL_COMBOBOX_02, {Selected=1}); -- Check if "Item C" was selected in the first combo box. elseif (strCTRL_COMBOBOX_02_TXT == "Item C") then -- Add two items to the second combo box control related to "Item C". DlgComboBox.AddItem(CTRL_COMBOBOX_02, "Item C Secondary One"); DlgComboBox.AddItem(CTRL_COMBOBOX_02, "Item C Secondary Two"); -- Set selected state of the second combo box to the first item in the list. DlgComboBox.SetProperties(CTRL_COMBOBOX_02, {Selected=1}); else -- Do nothing. end -- 进入下一个屏幕 Screen.Next();