Solved

Remove a value from array

Posted on 2016-07-21
2
59 Views
Last Modified: 2016-07-21
Hello,
i have this code on mouse over of datagridview

Private Sub Dg_Mousemove(sender As Object, e As MouseEventArgs)

        Dim ttText
        Dim i As Integer
        Try
            Dim dgv = CType(sender, DataGridView)
            Dim ht = dgv.HitTest(e.X, e.Y)
            If ht.Type = DataGridViewHitTestType.RowHeader AndAlso ht.RowIndex > -1 Then
                Dim row = dgv.Rows(ht.RowIndex)

               Dim values = (From cell As DataGridViewCell In row.Cells Select cell.FormattedValue).Cast(Of String).ToArray

                ttText = String.Join("; ", values)
                Dim oldText = If(tt.Tag Is Nothing, "", tt.Tag.ToString)
                If ttText <> oldText Then
                    tt.Tag = ttText
                    tt.Show(ttText, dgv, e.Location)
                End If
            Else
                tt.Hide(dgv)
            End If
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
        End Try
    End Sub

How ca ni remove the last value from values

When I try removeat ,it says removeat is not a member
0
Comment
Question by:RIAS
2 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 41722928
HI,

pls try

Array.Resize(values , values.Length - 1)

Open in new window

Regards
1
 

Author Closing Comment

by:RIAS
ID: 41722937
Worked like charm mate!Cheers!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question