questions

daloo3ah

New member
Joined
Jan 6, 2010
Messages
2
Programming Experience
Beginner
hi :)

1) if I have a lstbox with info, and txtboxes to display these information..
how to show the information in text boxes when I click on the items inside the listbox ?

2) I want to use a combo box.. with categories
and when i choose one category.. I want the other list box to display only the items of this category ?

3) I want to calculate the profit of employees per day and per person ?
( if i have a store )..

4) In that store I have many items to sell,, each has information..
if the customer buy from these items ,, how to change in the list box that the quantity of this items has decreased?
also if I'm using List Of and classes with the list box ( all to store informations about items )


please help ASAP :)
 
try this

Try these suggestions.

1.
VB.NET:
    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        TextBox1.Text = ListBox1.SelectedItem.ToString
    End Sub

2. Where are the items for the category stored?

VB.NET:
    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        Dim strcategory As String

        'get the category selected
        strcategory = ComboBox1.SelectedText

        'Now place code to get category item for the supplied strcategory 

    End Sub

3. This is basic code for math. I cannot give you an example with our more info on what kind of numbers your dealing with or where you are getting the numbers.

4.
VB.NET:
'Change the text of an item in a listbox.
          'Item purchased
          Dim stritem as String
          Dim intitemindex

          stritem = 'text from what ever control you are using for the user to select an item from

         intitemindex =  ListBox1.FindString(stritem)

         'Change the listbox item text
         'You have to delete the item then add it again in the same index
         'You'll have to look that up as I have not tried it.

Ty



Don't really understand how the List Of is involved if the items are in a list box. The information like this should be stored in a Database and then you create classes to represent the items and DB classes to do all the DB interaction to keep it all centralized.
 
no not that what i mean


If I have a store of items let's say.. books

and I don't want to use a database

so I save the books informations into a "txt file" .. then I create a class to take the info from the txtFile line by line

then
I insert these information into a listbox using classes and list Of ..


so ,, my questions is : how to show the information of any book selected in the list box ?

---------------------------

the second thing is :

I create categories for the books in a combo box

so what i want is :

when I choose one category .. the list box below the combo box .. will add the items that are in that category which I selected ... So how to do it ?

------------------------

third :
how to sell books .. in other words.

when I sell a book .. how to tell the program to decrease that book's quantity ?
-------------------------

last thing is :

I want to calculate the profit per employee & per day

so the manager can watch every transaction that done in the store .. in addition, he can see the total profit per his employee or per days ????



I'll be thankfull to fine answers :)
 
Back
Top