2008年7月29日 星期二

英文簡介產生器

image

image

程式碼

Public Class Form1
    Dim temStr1, temStr2, temStr3 As String
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        temStr1 = "My name is " & TextBox1.Text & ".  I am " & TextBox2.Text & " years old.  I live in " & TextBox3.Text & ".  I like cats.  ..."
        temStr2 = "Hey man,  I'm " & TextBox1.Text & ".  I don't really look my age even though I am " & TextBox2.Text _
                  & " years old.  I live in " & TextBox3.Text & " which is the most wonderful place in the world.  I hate cats, ... "
        temStr3 = "Sample1:" & vbNewLine & temStr1 & vbNewLine & vbNewLine & "Sample2:" & vbNewLine & temStr2
        TextBox4.Text = temStr3
        TextBox4.Font = New Font("Bookman Old Style", 11, System.Drawing.FontStyle.Bold)
    End Sub
End Class

沒有留言: