Website Design United States, Website Design California, Website Designing United States, Website Designing California

Possible to disable a Row in ListView?

Try this:

Imports System.Runtime.InteropServices
Public Class ListViewEx
Inherits ListView
Public Const WM_USER As Integer = &H400
Public Const WM_NOTIFY As Integer = &H4E
Public Const OCM__BASE As Integer = WM_USER + &H1C00
Public Const OCM_NOTIFY As Integer = OCM__BASE + WM_NOTIFY
Public Const LVN_FIRST As Integer = 0 - 100
Public Const LVN_ITEMCHANGING As Integer = LVN_FIRST - 0
Public Const LVIF_STATE As Integer = &H8
Public Const LVIS_SELECTED As Integer = &H2
<StructLayout(LayoutKind.Sequential)> Public Structure NMHDR
Public hwndFrom As IntPtr
Public idFrom As Integer
Public code As Integer
End Structure
<StructLayout(LayoutKind.Sequential)> Public Structure POINT
Public x As Integer
Public y As Integer
End Structure
<StructLayout(LayoutKind.Sequential)> Public Structure NMLISTVIEW
Public hdr As NMHDR
Public iItem As Integer
Public iSubItem As Integer
Public uNewState As Integer
Public uOldState As Integer
Public uChanged As Integer
Public ptAction As POINT
Public lParam As Integer
End Structure
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg = OCM_NOTIFY Then
Dim nm As NMHDR = CType(m.GetLParam(GetType(NMHDR)), NMHDR)
If nm.code = LVN_ITEMCHANGING Then
Dim nmlv As NMLISTVIEW =
CType(m.GetLParam(GetType(NMLISTVIEW)), NMLISTVIEW)
If nmlv.uChanged And LVIF_STATE Then
If nmlv.iItem = 0 Then
If nmlv.uNewState And LVIS_SELECTED Then
m.Result = New IntPtr(1)
Exit Sub
End If
End If
End If
End If
End If
MyBase.WndProc(m)
End Sub
End Class



    Enquiry
 






    Contact us
340 W, 26th Street, Suite F, National City, California - 91950 United States
Tel : 818-667-2853
Info@webbgirrl.com

















 

 

 

 

 

 

 

 

 

 

Ajax Technologies | Foodgear Shop| Lowest Unique Bid Auction | Our Team | Terms And Condition | What is encapsulation | MustInherit class with parameters in the constructor | How to extract src from img elements in html code | How to extract url and anchor from html content | Grab the content of a webpage using C | How to extract the host name from an url C| How to send an email using smtp C | How to remove html tags from web content C | How to convert date time to sql valid string | Set row color in datagrif web from | Disclaimer | How to refresh the data in an xml reader object | Aprendiendo ms access 2000 en 24 horas | Microsoft visual C++ net step by step | Possible to disable a row in listview | Designing sql server 2000 databases for net enterprise | Biztalk server 2000 developer guide for net
© 2008-2009 webbgirrl.com