Hi John,
I agree with Herfried's idea.
Here I write the code for you, you may have a try to see if this is what
you want.
Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential)> _
Public Structure LVITEM
Public mask As Int32
Public iItem As Int32
Public iSubItem As Int32
Public state As Int32
Public stateMask As Int32
Public pszText As String
Public cchTextMax As Int32
Public iImage As Int32
Public lParam As IntPtr
End Structure
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As Integer, ByRef
lParam As LVITEM) As Integer
Public Const LVM_SETITEM = &H1006
Public Const LVIS_CUT = &H4
Public Const LVIF_STATE = &H8
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ListView1.View = View.Details
' Add a column with width 80 and left alignment
ListView1.Columns.Add("File type", 80, HorizontalAlignment.Left)
ListView1.LargeImageList = ImageList1
ListView1.SmallImageList = ImageList1
ListView1.Items.Add("Item1", 0)
ListView1.Items.Add("Item2", 0)
Dim lv As New LVITEM
lv.iItem = 0
lv.mask = LVIF_STATE
lv.stateMask = LVIS_CUT
lv.state = LVIS_CUT
Dim rt As Boolean
rt = SendMessage(ListView1.Handle, LVM_SETITEM, 0, lv)
End Sub
LVITEM Structure
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/pla
tform/commctls/listview/structures/lvitem.asp
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure!
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.