题目内容:
请根据以下各小题的要求设计Visual Basic应用程序(包括界面和代码)。(1)在Form1的窗体上画一个名称为Pic1的图片框,然后建立一个主菜单,标题为"命令",名称为Com,该菜单有两个子菜单,其标题分别为"输出"和"删除",名称分别为Pri和Del,编写适当的事件过程。程序运行后,如果单击"命令"菜单中的"输出"命令,则将图片框显示出来;如果单击"删除"命令,则隐藏图片框。程序的运行情况如图27-1和图27-2所示。

图27-1

图27-2
注意:存盘时必须存放在考生文件夹下,工程文件名为sj1.vbp,窗体文件名为sj1.frm。程序中不得使用任何变量。
(2)在窗体上画一个列表框,名称为List1,通过"属性"窗口向列表框中添加3个项目,分别为"足球"、"篮球"和"排球"。编写适当的事件过程,使程序运行后,每次单击列表框中的任何一项,则总在最后面添加一项"体育活动"。程序运行界面和运行效果分别如图27-3和图27-4所示。

图27-3

图27-4
注意:存盘时必须存放在考生文件夹下,工程文件名为sj2.vbp,窗体文件名为sj2.frm。程序中不得使用任何变量。
参考答案:
答案解析: