想做一个窗体,有四个文本框和一个命令按钮。要求在三个文本框内输入任意的三个数后,单击命令按钮,则在第四个文本框中显示其中的中间数。不知道有没有说明白,请各位帮忙,谢谢!

热心网友

Dim a1, a2, a3, a4 As LongPrivate Sub Command1_Click()a1 = Text1.Texta2 = Text2.Texta3 = Text3.TextIf (a1 a2) And (a1 a3) Thena4 = a1End IfIf (a2 a1) And (a2 a3) Thena4 = a2End IfIf (a3 a1) And (a3 a2) Thena4 = a3End IfText4.Text = a4End Sub

热心网友

VB都忘得差不多了,只能给你一个思路if text1的值=text2的值 if text2的值=text3的值 text4的值=text2的值 else if text1的值=text3的值 text4的值=text3的值 else text4的值=text1的值 endif endifelse if text1的值=text3的值 text4的值=text1的值 else if text2的值=text3的值 text4的值=text3的值 else text4的值=text2的值 endif endifendif 。

热心网友

在命令按钮的代码的Click()函数后加上相应的内容就行了,你指的中间数应该就是三个文本框中的第二个吧,比如叫textbox2,就写成textbox4.test=textbox2.test不就成了

热心网友

这么简单还需要问,自己上学做什么了?