Results 1 to 3 of 3

Thread: listview help!(resolved)

  1. #1

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Cool listview help!(resolved)

    halu to everyone. i have this problem on how to subtract the amount from the listview.
    i have a form and a listview w/ 2 columns(amount and types of payment) and a textbox name:txttotalamount.
    i have a function on how to remove a selected item in the listview w/ the use of context menu.

    what i want is when the user select an item in the listview and remove the amount it will subtract to the total amount(txttotalamount.text).


    thanks in advance for the help...mate..
    Last edited by mar_zim; Jul 28th, 2004 at 03:43 AM.

  2. #2
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    psssst. wahehe. atay nimo mar_zim. haha.
    VB Code:
    1. Dim total As Decimal = 0
    2.    Dim li As ListViewItem
    3.    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    4.       li = ListView1.Items.Add(TextBox1.Text)
    5.       total += Decimal.Parse(TextBox1.Text)
    6.       TextBox3.Text = total.ToString
    7.       li.SubItems.Add(TextBox2.Text)
    8.    End Sub
    9.  
    10.    Private Sub ListView1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDown
    11.       li = ListView1.GetItemAt(e.X, e.Y)
    12.       total -= Decimal.Parse(li.Text)
    13.       TextBox3.Text = total.ToString
    14.       ListView1.Items.Remove(li)
    15.    End Sub
    hope this helps mate.

  3. #3

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416
    salamat bai brown monkey eating serpent eagle...lol..

    solbad na ang problema...

    dios nalang ang mag igo..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width