Solved

Remove a value from array

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

832 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