就是用VB. net输出:
*
* *
* * *
* *
*
想请哪位高手帮解决一下啊
谢谢
Dim g As Graphics
Dim rownum As Integer = 10
Private Sub Form3_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
g = e.Graphics
Dim row As Integer
Dim col As Integer
Dim sspace As String = "*"
Dim sstr As String = "*"
Dim spacelength As Integer = g.MeasureString(sspace, New Font("Times New Romain", 12, FontStyle.Regular)).Width
Dim strlength As Integer = g.MeasureString(sstr, New Font("Times New Romain", 12, FontStyle.Regular)).Width
For row = 1 To rownum
Dim m As Integer
g.DrawString(sstr, New Font("Times New Romain", 12, FontStyle.Regular), Brushes.Red, 50 + (rownum - row) * spacelength, 50 + (row - 1) * 10)
For m = 1 To row - 1
g.DrawString(sstr, New Font("Times New Romain", 12, FontStyle.Regular), Brushes.Red, 50 + (rownum - row) * spacelength + m * (spacelength + strlength), 50 + (row - 1) * 10)
' g.DrawString(sstr, New Font("Times New Romain", 12, FontStyle.Regular), Brushes.Red, 50 + strlength, 50 + (row - 1) * 10)
Next
g.DrawString(Environment.NewLine, New Font("Times New Romain", 12, FontStyle.Regular), Brushes.Red, Me.Width, 50 + (row - 1) * 10)
Next
g.Dispose()
End Sub
[此贴子已经被作者于2006-5-20 14:32:35编辑过]