1,根据命名规吵仿察范获知这是一个求直角三角形斜边的,函数为Hypotenuse(你仔细看看,有),
专注于为中小企业提供成都网站制作、成都做网站、外贸营销网站建设服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业城固免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了1000+企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。
他带有两个参数,分别是Text1和Text2里的内容,把两个内容转化为int类型后,直接根据函数Hypotenuse求出大帆 他的斜边,再转化为string类型让label1显示结果
2,升茄同理,这个也是计算斜边的,不过要得参数是宽和高,估计是求矩形里面对角线的
'代码来源:代码街codejie点虐
'由于在vb点虐 里变量名不区分大小写(StuName和stuname是一样的),所以个别变量名需要修改
'在vb点虐 中,模块级变量的命名原则是以m_开头
Public Class Student
Private m_stuNo As String '学生号字仿困纤段
Private m_stuName As String '学生姓名字段
Private m_stuAge As Integer '学生年龄尺掘字段
Private m_stuAddress As String '学生住址字段
'无参构造方法
Public Sub New()
End Sub
'有参构造方法
Public Sub New(ByVal stuNo As String, ByVal stuName As String, ByVal stuAge As Integer, ByVal stuAddress As String)
m_stuNo = stuNo
m_stuName = stuName
m_stuAge = stuAge
m_stuAddress = stuAddress
End Sub
'学生号属性
Public Property StuNo() As String
Get
Return m_stuNo
End Get
Set(ByVal value As String)
m_stuNo = value
End Set
End Property
'学生姓名属性
Public Property StuName() As String
Get
Return m_stuName
End Get
Set(ByVal value As String)
m_stuName = value
End Set
End Property
'学生备仿年龄属性
Public Property StuAge() As Integer
Get
Return m_stuAge
End Get
Set(ByVal value As Integer)
m_stuAge = value
End Set
End Property
'学生住址属性
Public Property StuAddress() As String
Get
Return m_stuAddress
End Get
Set(ByVal value As String)
m_stuAddress = value
End Set
End Property
End Class
这个应该可以,已经腔册薯通过姿毁VB2010测试:
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text "" Then
If Microsoft.VisualBasic.Right(TextBox1.Text, 1) = "/" Or Microsoft.VisualBasic.Right(TextBox1.Text, 1) = "*"伍者 Or _
Microsoft.VisualBasic.Right(TextBox1.Text, 1) = "?" Or Microsoft.VisualBasic.Right(TextBox1.Text, 1) = "" Or _
Microsoft.VisualBasic.Right(TextBox1.Text, 1) = "" Then
TextBox1.Text = Microsoft.VisualBasic.Left(TextBox1.Text, Len(TextBox1.Text) - 1)
TextBox1.SelectionStart = Len(TextBox1.Text)
End If
End If
End Sub
售后响应及时
7×24小时客服热线数据备份
更安全、更高效、更稳定价格公道精准
项目经理精准报价不弄虚作假合作无风险
重合同讲信誉,无效全额退款