DOC

vb4

By Martha Hart,2014-05-10 16:22
16 views 0
vb4

1. 放大

    Private Sub Command1_Click() Dim x

    x = Int((5 * Rnd) + 1) Text1.FontSize = x * 30 End Sub

     缩小

    Private Sub Command2_Click() Dim x

    x = Text1.FontSize

    x = x - Int((x * Rnd) + 1) Text1.FontSize = IIf(x = 0, 30, x)

    End Sub

    2,Private Sub Command1_Click()

Dim s As String

    Randomize

    s = Chr(Int(Rnd * 14) + 70) Print "" & s & "ASCII" & Asc(s) 随机生成字母;他的码为

    End Sub

    3..c=inputbox("","","fdcdfsa") 请输入字符串提示

    if lcase(mid(c,3,1))="c" then msgbox "yes"

    else

    msgbox "no"

    end if

    4Private Sub Command1_Click() Dim Y As Integer

    For Y = 2000 To 2010

    Me.Print Y & IIf(Day(DateSerial(Y, 3, 0)) = 29, "闰年", "平年")

Next

    End Sub

    Function IsLeapYearA(ByVal yr As Integer) As Boolean If ((yr Mod 4) = 0) Then IsLeapYearA = ((yr Mod 100) 0) Or ((yr Mod 400) = 0) End If

    End Function

    Public Function IsLeapYearB(ByVal yr As Integer) As Boolean IsLeapYearB = Day(DateSerial(yr, 2, 29)) = 29 End Function

Report this document

For any questions or suggestions please email
cust-service@docsford.com