在菜单编辑器中建立一个菜单,其主菜单项的名称为mnuEdit,Visible属性为False,程序运行后,如果用鼠标右键单击窗体,则弹出与mnuEdit相应的菜单。以下是实现上述功能的程序,请填空。
Private Sub Form ______ (Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button=2 Then
______ mnuEdit
End If
End Sub
发布于 2022-05-11 10:20:00
登录后免费查看答案
关注者
0
被浏览
13
1 个回答
推荐阅读
-
在菜单编辑器中建立1个名称为Menu0的菜单项,将其“可见”属性设置为False,并建立其若干子菜单,然后编写如下过程:Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)If Button=1 ThenPopupMenu Menu0End IfEnd Sub则以下叙述中错误的是。
2022-05-11 关注 0 浏览13 1答案
-
有一个名称为Fom1的窗体,上面没有控件,设有下列程序(其中方法PSet(X,Y)的功能是在坐标X、Y处画一个点):Dim cmdmave As BooleanPrivate Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single,Y AsSingle)cmdmave =TrueEnd SubPrivate Sub Form MouseMove(Button As Integer,Shift As Integer,X As Single,Y AsSingle)If cmdmave ThenForm1.PSet(X,Y)End IfEnd SubPrivate Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Singgle)cmdmave=FalseEnd Sub此程序的功能是( )。
2022-05-11 关注 0 浏览13 1答案
-
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:Dim SW As BooleanFunction func(X As Integer) As IntegerIf X < 20 ThenY = XElseY = 20 + XEnd Iffunc = YEnd FunctionPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)SW = FalseEnd SubPrivate Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)SW = TrueEnd SubPrivate Sub Command1_Click()Dim intNum As IntegerintNum = InputBox("")If SW ThenPrint func(intNum)End IfEnd Sub程序运行后,单击命令按钮,将显示一个输入对话框,如果在输入对话框中输入25,则程序的执行结果为( )。
2022-05-11 关注 0 浏览12 1答案
-
假定有如下事件过程:Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)If Button = 2 ThenPopupMenu popFormEnd IfEnd Sub则以下描述中错误的是
2022-05-11 关注 0 浏览11 1答案
-
有一个名称为Form1的窗体,上面没有控件,设有以下程序(其中方法Pset(X,Y)的功能是在坐标X,Y 处画一个点):Di mc mdmave As BooleanPrivate Sub Form_MouseDown (Button As Integer ,Shift As Integer ,X As Si ngle ,Y As Si ngle) c mdmave =TrueEnd SubPrivate Sub Form_Mouse Move(Button As Integer ,ShiftAs Integer ,X As Si ngle ,Y As Si ngle) If c mdmave Then Form1.Pset(X,Y)End IfEnd SubPrivate Sub Form_Mouse Up(Button As Integer ,ShiftAs Integer ,X As Si ngle ,Y As Si ngle) c mdmave =FalseEnd Sub此程序的功能是( )。
2022-05-11 关注 0 浏览7 1答案
-
若看到程序中确以下事件过程,则可以肯定的是,当程序运行时( )。Private Sub Click—MouseDown(Button As Integer,Shift As Integer,X As Single,YAs Single)Print"VB Program"End Sub
2022-05-11 关注 0 浏览10 1答案
-
设窗体上有一个名为Text1的文本框,并编写如下程序:Private Sub Form_Load()ShowText1.Text = ""Text1.SetFocusEnd SubPrivate Sub Form_MouseUp(Button As Integer, _Shift As Integer, X As Single, Y As Single)Print "程序设计"End SubPrivate Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)Print "Visual Basic";End Sub程序运行后,如果在文本框中输入字母“a”,然后单击窗体,则在窗体上显示的内容是
2022-05-11 关注 0 浏览16 1答案
-
在窗体上画1个命令按钮,名称为Command1,然后编写如下程序:Dim Flag As BooleanPrivate Sub Command1_Click()Dim intNum As IntegerintNum=InputBox("请输入:")If Flag ThenPrint f(intNum)End IfEnd SubFunction f(X As Integer)As IntegerIf X<10 ThenY=XElseY=X+10End Iff=YEnd FunctionPrivate Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single)Flag=TrueEnd Sub运行程序,首先单击窗体,然后单击命令按钮,在输入对话框中输入5,则程序的输出结果为。
2022-05-11 关注 0 浏览13 1答案
-
若看到程序中有以下事件过程,则可以肯定的是,当程序运行时Private Sub Click_MouseDown(Button As Integer,_Shift As Integer,X As Single,Y As Single)Print “VB Program”End Sub
2022-05-11 关注 0 浏览11 1答案
-
在窗体上画一个名称为Co mmand1的命令按钮,然后编写如下程序:Di mSW As BooleanFunction func(X As Integer)As IntegerIf X<20ThenY =XElseY =20+XEnd Iffunc =YEnd FunctionPrivate Sub Form_MouseDown(Button As Integer ,_Shift As Integer ,X As Si ngle ,Y As Si ngle)SW=FalseEnd SubPrivate Sub Form_Mouse Up(Button As Integer ,_Shift As Integer ,X As Si ngle ,Y As Si ngle)SW=TrueEnd SubPrivate Sub Co mmand1_Click()Di mi nt Num As Integeri nt Num=InputBox("")If SW ThenPrint func(i nt Num)End IfEnd Sub程序运行后,单击命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序的执行结果为( )。
2022-05-11 关注 0 浏览10 1答案