fswb.net
当前位置:首页>>关于在VB中有text1,text2,text3,command1在text1,text2...的资料>>

在VB中有text1,text2,text3,command1在text1,text2...

Private Sub Command1_Click()Dim a As Date, b As Datea = CDate(Text1.Text)b = CDate(Text2.Text)Text3.Text = a + bEnd Sub

代码如下: Private Sub command1_click()if isnumeric(text1.text)=Flase or text1.text="" then exit sub '如果不是数字或为空,不继续if isnumeric(text2.text)=Flase or text2.text="" then exit sub '如果不是数字或为空,不继续Text3.Text...

Option Explicit Private Sub Command1_Click() Dim myLine1() As String, myLine2() As String, i As Integer, j As Integer myLine1 = Split(Text1.Text, vbCrLf) myLine2 = Split(Text2.Text, vbCrLf) Text3.Text = "" For i = 0 To UBound(m...

Dim a, b, c, s As Integer a = Text2.Text b = Text3.Text c = Text4.Text If a > b Then s = a If a > c Then s = a Else s = c End If Else s = b If b > c Then s = b Else s = c End If End If Print s

代码如下: Private Sub Text1_Change()If IsNumeric(Text1) = False Then Exit Sub '不是数字结束Select Case Val(Text1)Case Is < 0 '小于零,不处理Case Is = 0 '等于零Text3 = Text1Case Is < 20 '大于零,小于20Text4 = Text1Case Is >= 15...

text4的代码是:text4.text=val(text1.text)+val(text2.text)+val(text3.text),有什么不懂得还可以问我

代码不复杂: 在窗体上绘制圆的语句: Me.Circle (x, y), radius 其中:x, y就是圆心的坐标,radius就是圆半径 你的这些数据来自于文本框,那么可以这样来实现: Me.Circle (Val(Text1.text),Val(Text2.text)), Val(Text3.text)

Private Sub Form_Load() Text3.Enabled = False End Sub Private Sub Text1_Change() Text3.Text = Val(Text1.Text) ^ 2 + Val(Text2.Text) ^ 2 End Sub Private Sub Text2_Change() Text3.Text = Val(Text1.Text) ^ 2 + Val(Text2.Text) ^ 2 E...

Private Sub Command1_Click() a = Val(Text1) op = Text2 b = Val(Text3) Select Case op Case "+" c = a + b Case "-" c = a - b Case "*" c = a * b Case "/" If b 0 Then c = a / b Else c = "除数不能为0!" End Select Text4 = c End Sub ...

不一定非要用数据库嘛,直接把文本框text1、2、3的值赋到表格的单元格即可。 比如mshflexgrid的单元格赋值是 mshFlexGrid1.TextMatrix(r,c)=text1.text 'r、c为要赋值的行、列号

网站首页 | 网站地图
All rights reserved Powered by www.fswb.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com