Solved

Remove a value from array

Posted on 2016-07-21
2
41 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 49

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now