473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Listview ghosted property

I have a VB6 project that uses the ghosted property of a
listitem in a listview.
I am trying to convert it to VB.NET but the ghosted
property appears to have been removed.
Is there a VB.NET equivalent?

Thanks
Nov 20 '05 #1
4 5463
* "John" <jo**@scsonline.com> scripsit:
I have a VB6 project that uses the ghosted property of a
listitem in a listview.
I am trying to convert it to VB.NET but the ghosted
property appears to have been removed.
Is there a VB.NET equivalent?


No. The property doesn't exist and you cannot access it direclty. You
will have to dig down to the original 'LVITEM' structure (writing a new
wrapper for the Win32 ListView control).

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
This reply is for Peter Huang of microsoft.
I cannot find your reply to my original post.
I have followed the link in your email but the newsgroup
only shows my original post and a reply from someone
called Herfried.
I would very much like to see your reply - have you any
ideas as to why I can't?
-----Original Message-----
I have a VB6 project that uses the ghosted property of a
listitem in a listview.
I am trying to convert it to VB.NET but the ghosted
property appears to have been removed.
Is there a VB.NET equivalent?

Thanks
.

Nov 20 '05 #3
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/de...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.

Nov 20 '05 #4
* "John" <jo**@scsonline.com> scripsit:
Thanks for the code Peter.
It works fine which makes me wonder why couldn't the
ghosted property have been left in if the underlying
mechanism is still available?


..NET Windows forms controls are mostly a wrapper for the underlying
Windows controls. For some reason, not all properties/... are exposed
to the user by the wrapper...

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mike Barrett | last post by:
I have a strange one here and I believe it is a bug. I googled it and saw others having a similar issue and nobody seems to have a fix. I will take another shot. I get this ERROR MESSAGE... ...
7
by: Dave Y | last post by:
I am a newbie to C# and am having trouble trying to override a ListView property method. I have created a new class derived from the Forms.Listview and I cannot figure out the syntax to override...
3
by: MikeY | last post by:
Hopefully someone can help me on this. I am using C#, making Windows forms. I have created a listView with checkbox's. I have enabled the checkboxes under the properties, and all the data,...
0
by: Dinesh Jain | last post by:
Hi all, To give functionality like cut-paste, I used listview1.listitems.item(0).ghosted=true in VB. But what is it's equivalent in VB.NET ? Please help, Thanks in advance, -Regards,
1
by: Derck | last post by:
SORRY, for the crosspost, but I think I posted it in the wrong group! Hello all, I have a question.. I am tying to make a global listview class where other listviews in my application points...
0
by: Mike Barrett | last post by:
I have a strange one here and I believe it is a bug. I googled it and saw others having a similar issue and nobody seems to have a fix. I will take another shot. I get this ERROR MESSAGE... ...
6
by: Dave | last post by:
VB6 has a SorkKey property that you can setup on the ListView control to tell the ListView what column to use for sorting. In .NET there is a Sort() method and a SortOrder property that you can...
12
by: garyusenet | last post by:
I have had no replies to my previous post so perhaps I didn't write it good enough. Please excuse new thread but i wanted to break from the last thread hopefully this thread will be better. ...
6
by: Rich Raffenetti | last post by:
I have a form with a listview control and a textbox. When I change focus from the listview to the textbox, the highlighted item on the listview loses the highlight. That is not the behavior I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.