Results 1 to 3 of 3

Thread: Controls in VB.NET

  1. #1
    Davisricky is offline Senior Member
    Join Date
    Dec 2009
    Posts
    331
    Rep Power
    3

    Default Controls in VB.NET

    Problem with Listview Controls in VB.NET

    I am learning VB.Net programming language. I am having a problem with the listview control in VB.NET. In fact I want to add a certain value at a certain place for a listview in VB.net. For example consider adding a new row at the currently chosen area. The program which I have does the addition of new rows but at the location '0' . gently give a appropriate solution.

  2. #2
    Garcíarobine is offline Senior Member
    Join Date
    Dec 2009
    Posts
    334
    Rep Power
    3

    Default

    It would be better to implement a solution to your problem, if you provide additional information on this issue. Be clearer that you really mean by a new line in the selected area. Please try to provide a clear picture of your problem. As far as I know VB.NET object Listview adds a row at the bottom, rather than adding a line on the site 0.
    Last edited by nitesh14; 02-06-2010 at 04:05 PM.

  3. #3
    RodríguezBrown is offline Senior Member
    Join Date
    Dec 2009
    Posts
    322
    Rep Power
    3

    Default

    I will advise another approach to get this you can get the selected row by simply looking it's index in the SelectedIndices() array's position ZERO. Why are you very much sure that this item will be in position 0 is. Since this array will have only one item because you are keep multiselect FALSE. Use the code given below.

    Dim Max As Integer = lsvReceipts.SelectedIndices.Item(0)
    For Counter = 0 To lsvReceipts.SelectedIndices.Count - 1
    If Max < lsvReceipts.SelectedIndices.Item(Counter) Then
    Max = lsvReceipts.SelectedIndices.Item(Counter)
    End If
    Last edited by nitesh14; 02-06-2010 at 04:05 PM.

Similar Threads

  1. Different ASP.net validation controls
    By CoxWatson in forum Programming
    Replies: 0
    Last Post: 05-13-2010, 01:49 PM
  2. Rotating Controls in ASP.NET
    By Izzie Itskowitz in forum Programming
    Replies: 2
    Last Post: 03-30-2010, 12:41 PM
  3. Creating Controls in a Loop
    By RodríguezBrown in forum Programming
    Replies: 1
    Last Post: 02-08-2010, 01:04 PM
  4. ActiveX controls
    By ponting77 in forum General Software Terms
    Replies: 0
    Last Post: 02-25-2009, 07:48 AM
  5. The Controls?
    By Newtech32 in forum Hard Disk
    Replies: 0
    Last Post: 04-15-2008, 09:25 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48