久违的--大二下学期第一章

Imports System.Math
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim h%, m%, s%, x%
        x = Val(TextBox1.Text)
        s = x Mod 60
        m = (x \ 60) Mod 60
        h = x \ 3600
        Label2.Text = h & ":" & m & ":" & s



    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Height = 250
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Me.Height = 400
    End Sub

    Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
        Dim c As Char
        c = Trim(ComboBox1.Text)
        Select Case c
            Case "+"
                TextBox4.Text = Val(TextBox2.Text) + Val(TextBox3.Text)
            Case "-"
                TextBox4.Text = Val(TextBox2.Text) - Val(TextBox3.Text)
            Case "*"
                TextBox4.Text = Val(TextBox2.Text) * Val(TextBox3.Text)
            Case "/"
                TextBox4.Text = Val(TextBox2.Text) / Val(TextBox3.Text)

        End Select
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        TextBox6.Text = Sin(Val(TextBox5.Text))
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        TextBox6.Text = Sqrt(Val(TextBox5.Text))
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        TextBox6.Text = Oct(Val(TextBox5.Text))
    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        TextBox6.Text = Cos(Val(TextBox5.Text))
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        TextBox6.Text = Log(Val(TextBox5.Text))
    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        TextBox6.Text = Hex(Val(TextBox5.Text))
    End Sub

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        Dim i As Integer, c As Char
        Randomize()
        Label4.Text = ""
        For i = 1 To 10
            Label4.Text &= Chr(Int(Rnd() * 26 + 65)) & " "
        Next

    End Sub
End Class


好久不写,感觉手生了不少

赶紧捡起节操。久违了-优快云

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值