VB2005实验中五金商店商品表格VB2005实验中五金商店商品表格
窗口面做出这样的效果,按顺序就行
具体程序如下:
Imports System.IO
Structure hardware
Dim no As Integer
Dim name As String
Dim num As Integer
Dim price As Single
End Structure
Public Class Form1
Dim it As hardware
Dim num As Integer
Private Sub Button1_Clic...
VB2005实验中五金商店商品#
格#
窗口面做出这样的效果,按顺序就行
具体程序如下:
Imports System.IO
Structure hardware
Dim no As Integer
Dim name As String
Dim num As Integer
Dim price As Single
End Structure
Public Class Form1
Dim it As hardware
Dim num As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
it.no = TextBox1.Text
it.name = TextBox2.Text
it.num = TextBox3.Text
it.price = TextBox4.Text
ListBox1.Items.Add(TextBox1.Text + Chr(9) + TextBox2.Text + Chr(9) + TextBox3.Text + Chr(9) +
TextBox4.Text)
FilePut(1, it, it.no)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim fs As New FileStream(Application.StartupPath & "\hardware1.dat", FileMode.OpenOrCreate,
FileAccess.ReadWrite)
Dim Sr As New StreamReader(fs)
Sr = New StreamReader(fs)
ListBox1.Text = Sr.ReadToEnd()
Sr.Close()
fs.Close()
Sr = Nothing
fs = Nothing
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim i As Integer = Val(ListBox1.SelectedItem)
ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
it = Nothing
FilePut(1, it, i)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
FileOpen(1, "d:\hardware.txt", OpenMode.Random, , , Len(it))
Dim i As Integer
it = Nothing
For i = 1 To 100
FilePut(1, it, i)
Next
End Sub
End Class
本文档为【VB2005实验中五金商店商品表格】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。