Solved

Remove a value from array

Posted on 2016-07-21
2
66 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 51

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to call new form in VB2013? 4 37
What is needed to become a DBA? 7 56
VB .net 2010 Byte array 2 22
ErrorKind in crystal reprot VB.Net 1 14
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

751 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