要用就少在那機掰
Would you like to react to this message? Create an account in a few clicks or log in to continue.

2010 12 27 2提

向下

2010 12      27          2提 Empty 2010 12 27 2提

發表  stty0910 周一 12月 27, 2010 9:00 am

Public Class Form1
Public Structure candystru
Dim sno As String
Dim sname As String
Dim sprice As Integer
End Structure
Private Sub form1_load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

End Sub

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim candy(10) As candystru
Dim str1 = ""
candy(1).sno = "A001"
candy(1).sname = "巧克力"
candy(1).sprice = 100
candy(2).sno = "A002"
candy(2).sname = "牛奶糖"
candy(2).sprice = 30
candy(0).sno = "A002"
candy(0).sname = "口香糖"
candy(0).sprice = 20
For i = 0 To 2
str1 = str1 & candy(i).sno & vbNewLine
str1 &= candy(i).sname & vbNewLine
str1 &= candy(i).sprice & vbNewLine

Next
TextBox1.Text = str1

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class

stty0910
終極管理員
終極管理員

文章數 : 68
注冊日期 : 2010-08-06
年齡 : 30
來自 : 地球某個角落

https://bear.666forum.com

回頂端 向下

回頂端


 
這個論壇的權限:
無法 在這個版面回復文章