Solved

Remove a value from array

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 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

15 Experts available now in Live!

Get 1:1 Help Now