Hi Everyone!
I have made form 5 to become a simple storage system to check for item stocks plus adding, and started to code with arrays.
heres what I have so far.
Public Class Form5
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckButton.Click
Dim item(2) As String
Dim itemstocks(2) As Integer
If ListBox1.SelectedIndex = 0 Then
itemstocks(0) = 100
Label1.Text = itemstocks(0).ToString
End If
End Sub
Private Sub AddButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddButton.Click
Dim stockamoumnt As Integer
Dim itemstocks(2) As Integer
If ListBox1.SelectedIndex = 0 Then
stockamoumnt = Integer.Parse(StockTextBox.Text)
itemstocks(0) = 100 + stockamoumnt
Label1.Text = itemstocks(0).tostring
End If
End Sub
Private Sub ClearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearButton.Click
Label1.Text = ""
End Sub
End Class
The part I highlighted red, I want to perform the adding of my stock for the item, but I don't want it to be 100, even thought the part in green I made it to become 100(just to see if it works),What I really wanted it to be able to do is link with another form, so the itemstocks(0) can be vary.
for example:
In form3 I have a listbox for my items, and each i assign it with 100,150 and 200 items to the itemstocks.I made a purchase button and a textbox to purchase the amount of a certain item, so when items are purchased, the amount decreases by the amount purchased, and in form 5 I might be able to check it, and be able to add the stock amount for the ones which run out.
Any suggestions about how to make it is appreciated.
Thank you!