如何根据popupmenu内容用pushbutton控制edit中的内容
现在有一个popupmenu,pushbutton和两个edit还有一个textpopupmenu中有三个选项A,B,C,当选A或B时text中显示A或B,此时若按pus...
现在有一个popupmenu ,pushbutton和两个edit 还有一个text
popupmenu中有三个选项A,B,C,当选A或B时text中显示A或B,此时若按pushbutton,则两个edit中都显示0,text中显示‘输入完成’
当popupmenu选C时,text中显示C,此时若按pushbutton,则两个edit中可以输入任何两个小于10的数字,并在text中显示‘输入完成’
这个程序应该怎么编,谢谢大家啦 展开
popupmenu中有三个选项A,B,C,当选A或B时text中显示A或B,此时若按pushbutton,则两个edit中都显示0,text中显示‘输入完成’
当popupmenu选C时,text中显示C,此时若按pushbutton,则两个edit中可以输入任何两个小于10的数字,并在text中显示‘输入完成’
这个程序应该怎么编,谢谢大家啦 展开
1个回答
展开全部
Private Sub Command1_Click()
If Label1.Caption = "A" Or Label1.Caption = "B" Then
Text1.Text = "0"
Text2.Text = "0"
End If
Label1.Caption = "输入完成"
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
Me.PopupMenu PopMenu1
End If
End Sub
Private Sub PopMenu_A_Click()
Label1.Caption = "A"
End Sub
Private Sub PopMenu_B_Click()
Label1.Caption = "B"
End Sub
Private Sub PopMenu_C_Click()
Label1.Caption = "C"
End Sub
你的题目写的不太清楚
If Label1.Caption = "A" Or Label1.Caption = "B" Then
Text1.Text = "0"
Text2.Text = "0"
End If
Label1.Caption = "输入完成"
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
Me.PopupMenu PopMenu1
End If
End Sub
Private Sub PopMenu_A_Click()
Label1.Caption = "A"
End Sub
Private Sub PopMenu_B_Click()
Label1.Caption = "B"
End Sub
Private Sub PopMenu_C_Click()
Label1.Caption = "C"
End Sub
你的题目写的不太清楚
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询