473,406 Members | 2,713 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,406 software developers and data experts.

Subitems in a Listview Control

Hello,

I've noticed through searching this group's previous posts that one can get
the item the mouse is over in a listview control but I did not see how to get
the subitem the mouse is over. Is this possible?

I intend on replacing an ActiveX grid with a listview control from a VB6
application that I've upgraded to VB .NET. The existing functionlality uses
the mouseover event of the grid to display specific information within
individual cells of the grid.

Thanks!
Jack

Nov 21 '05 #1
6 5011
J L
Hi Jack,
Here is the code someone shared with me previously and I am passing
along to you. I use it extenstively...you should be able to cut and
paste to get it to work.

Structure RECT
Public left As Integer
Public top As Integer
Public right As Integer
Public bottom As Integer
End Structure 'RECT

Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As
IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam
As RECT) As Integer

Public Function GetListViewSubItem(ByVal listView1 As ListView,
ByVal pt As Point) As Integer
Try
'
'***** IMPORTANT ***** The ListView must be set for FullRowSelect!!
'
Const LVM_FIRST As Integer = &H1000
Const LVM_GETSUBITEMRECT As Integer = LVM_FIRST + 56
Const LVIR_BOUNDS As Integer = 0

Dim myrect As RECT
Dim lvitem As ListViewItem = listView1.GetItemAt(pt.X, pt.Y)
If lvitem Is Nothing AndAlso listView1.SelectedItems.Count > 0
Then
lvitem = listView1.SelectedItems(0)
End If
Dim intLVSubItemIndex As Integer = -1
Dim LVSubItem As ListViewItem.ListViewSubItem = Nothing

If Not (lvitem Is Nothing) Then
Dim intSendMessage As Integer
Dim i As Integer
For i = 1 To lvitem.SubItems.Count - 1
LVSubItem = lvitem.SubItems(i)
myrect = New RECT
myrect.top = i
myrect.left = LVIR_BOUNDS
intSendMessage = SendMessage(listView1.Handle,
LVM_GETSUBITEMRECT, lvitem.Index, myrect)
If pt.X < myrect.left Then
LVSubItem = lvitem.SubItems(0)
intLVSubItemIndex = 0
Exit For
ElseIf pt.X >= myrect.left And pt.X <= myrect.right
Then
intLVSubItemIndex = i
Exit For
Else
LVSubItem = Nothing
End If
Next i
End If
If LVSubItem Is Nothing OrElse lvitem Is Nothing Then
intLVSubItemIndex = -1
End If
Return intLVSubItemIndex
Catch ex As Exception
ErrHandler("MarymonteUtilities - GetListViewSubItem", ex)
End Try
End Function
On Mon, 30 May 2005 12:04:03 -0700, "Jack"
<Ja**@discussions.microsoft.com> wrote:
Hello,

I've noticed through searching this group's previous posts that one can get
the item the mouse is over in a listview control but I did not see how to get
the subitem the mouse is over. Is this possible?

I intend on replacing an ActiveX grid with a listview control from a VB6
application that I've upgraded to VB .NET. The existing functionlality uses
the mouseover event of the grid to display specific information within
individual cells of the grid.

Thanks!
Jack


Nov 21 '05 #2
Thank you for the code. I did cut and paste it into a test application and
the coordinates for subitems seems to be off a little bit. I'm calling the
procedure you provided in the MouseHover event below:

Private Sub grdData_MouseHover(ByVal sender As Object, ByVal e As
System.EventArgs) Handles grdData.MouseHover
Me.ToolTip1.SetToolTip(grdData, GetListViewSubItem(grdData,
sender.mouseposition))
End Sub

grdData is the listview control. The subitem index that is shown in the tool
tip seems to be off by one column. It seems to be looking at the column to
the right of the column where the mouse is hovering over. Am I doing
something wrong?

Jack
"J L" wrote:
Hi Jack,
Here is the code someone shared with me previously and I am passing
along to you. I use it extenstively...you should be able to cut and
paste to get it to work.

Structure RECT
Public left As Integer
Public top As Integer
Public right As Integer
Public bottom As Integer
End Structure 'RECT

Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As
IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam
As RECT) As Integer

Public Function GetListViewSubItem(ByVal listView1 As ListView,
ByVal pt As Point) As Integer
Try
'
'***** IMPORTANT ***** The ListView must be set for FullRowSelect!!
'
Const LVM_FIRST As Integer = &H1000
Const LVM_GETSUBITEMRECT As Integer = LVM_FIRST + 56
Const LVIR_BOUNDS As Integer = 0

Dim myrect As RECT
Dim lvitem As ListViewItem = listView1.GetItemAt(pt.X, pt.Y)
If lvitem Is Nothing AndAlso listView1.SelectedItems.Count > 0
Then
lvitem = listView1.SelectedItems(0)
End If
Dim intLVSubItemIndex As Integer = -1
Dim LVSubItem As ListViewItem.ListViewSubItem = Nothing

If Not (lvitem Is Nothing) Then
Dim intSendMessage As Integer
Dim i As Integer
For i = 1 To lvitem.SubItems.Count - 1
LVSubItem = lvitem.SubItems(i)
myrect = New RECT
myrect.top = i
myrect.left = LVIR_BOUNDS
intSendMessage = SendMessage(listView1.Handle,
LVM_GETSUBITEMRECT, lvitem.Index, myrect)
If pt.X < myrect.left Then
LVSubItem = lvitem.SubItems(0)
intLVSubItemIndex = 0
Exit For
ElseIf pt.X >= myrect.left And pt.X <= myrect.right
Then
intLVSubItemIndex = i
Exit For
Else
LVSubItem = Nothing
End If
Next i
End If
If LVSubItem Is Nothing OrElse lvitem Is Nothing Then
intLVSubItemIndex = -1
End If
Return intLVSubItemIndex
Catch ex As Exception
ErrHandler("MarymonteUtilities - GetListViewSubItem", ex)
End Try
End Function
On Mon, 30 May 2005 12:04:03 -0700, "Jack"
<Ja**@discussions.microsoft.com> wrote:
Hello,

I've noticed through searching this group's previous posts that one can get
the item the mouse is over in a listview control but I did not see how to get
the subitem the mouse is over. Is this possible?

I intend on replacing an ActiveX grid with a listview control from a VB6
application that I've upgraded to VB .NET. The existing functionlality uses
the mouseover event of the grid to display specific information within
individual cells of the grid.

Thanks!
Jack


Nov 21 '05 #3
J L
I dont find a Sender.Mouseposition property in the hover event.

I set the mouse location in the mouse move event and also display the
associated tip in that event.

Those are the only differences I can see.

John

So perhaps it is in the hover and sender.mouseposition
On Tue, 31 May 2005 05:35:02 -0700, "Jack"
<Ja**@discussions.microsoft.com> wrote:
Thank you for the code. I did cut and paste it into a test application and
the coordinates for subitems seems to be off a little bit. I'm calling the
procedure you provided in the MouseHover event below:

Private Sub grdData_MouseHover(ByVal sender As Object, ByVal e As
System.EventArgs) Handles grdData.MouseHover
Me.ToolTip1.SetToolTip(grdData, GetListViewSubItem(grdData,
sender.mouseposition))
End Sub

grdData is the listview control. The subitem index that is shown in the tool
tip seems to be off by one column. It seems to be looking at the column to
the right of the column where the mouse is hovering over. Am I doing
something wrong?

Jack
"J L" wrote:
Hi Jack,
Here is the code someone shared with me previously and I am passing
along to you. I use it extenstively...you should be able to cut and
paste to get it to work.

Structure RECT
Public left As Integer
Public top As Integer
Public right As Integer
Public bottom As Integer
End Structure 'RECT

Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As
IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam
As RECT) As Integer

Public Function GetListViewSubItem(ByVal listView1 As ListView,
ByVal pt As Point) As Integer
Try
'
'***** IMPORTANT ***** The ListView must be set for FullRowSelect!!
'
Const LVM_FIRST As Integer = &H1000
Const LVM_GETSUBITEMRECT As Integer = LVM_FIRST + 56
Const LVIR_BOUNDS As Integer = 0

Dim myrect As RECT
Dim lvitem As ListViewItem = listView1.GetItemAt(pt.X, pt.Y)
If lvitem Is Nothing AndAlso listView1.SelectedItems.Count > 0
Then
lvitem = listView1.SelectedItems(0)
End If
Dim intLVSubItemIndex As Integer = -1
Dim LVSubItem As ListViewItem.ListViewSubItem = Nothing

If Not (lvitem Is Nothing) Then
Dim intSendMessage As Integer
Dim i As Integer
For i = 1 To lvitem.SubItems.Count - 1
LVSubItem = lvitem.SubItems(i)
myrect = New RECT
myrect.top = i
myrect.left = LVIR_BOUNDS
intSendMessage = SendMessage(listView1.Handle,
LVM_GETSUBITEMRECT, lvitem.Index, myrect)
If pt.X < myrect.left Then
LVSubItem = lvitem.SubItems(0)
intLVSubItemIndex = 0
Exit For
ElseIf pt.X >= myrect.left And pt.X <= myrect.right
Then
intLVSubItemIndex = i
Exit For
Else
LVSubItem = Nothing
End If
Next i
End If
If LVSubItem Is Nothing OrElse lvitem Is Nothing Then
intLVSubItemIndex = -1
End If
Return intLVSubItemIndex
Catch ex As Exception
ErrHandler("MarymonteUtilities - GetListViewSubItem", ex)
End Try
End Function
On Mon, 30 May 2005 12:04:03 -0700, "Jack"
<Ja**@discussions.microsoft.com> wrote:
>Hello,
>
>I've noticed through searching this group's previous posts that one can get
>the item the mouse is over in a listview control but I did not see how to get
>the subitem the mouse is over. Is this possible?
>
>I intend on replacing an ActiveX grid with a listview control from a VB6
>application that I've upgraded to VB .NET. The existing functionlality uses
>the mouseover event of the grid to display specific information within
>individual cells of the grid.
>
>Thanks!
>Jack



Nov 21 '05 #4
Nevermind. I was passing in the incorrect Point. I was passing in the
mouseposition of the listview control when I should have been sending in the
x and y coordinates of the event argument as a new point. Here is the code
for anyone with this same issue (I also moved the code to MouseOver from
MouseHover):

Private Sub GridData_MouseMove(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles grdData.MouseMove
Dim lvSubItem As ListViewItem.ListViewSubItem
lvSubItem = GetListViewSubItem(grdData, New Point(e.X, e.Y))
If Not lvSubItem Is Nothing Then
Me.ToolTip1.SetToolTip(grdData, lvSubItem.Text)
Else
Me.ToolTip1.RemoveAll()
End If
End Sub
P.S. I also modified the GetListViewSubItem procedure to pass back the
subitem object instead of the index.

Thanks for you help!!

Jack

"Jack" wrote:
Thank you for the code. I did cut and paste it into a test application and
the coordinates for subitems seems to be off a little bit. I'm calling the
procedure you provided in the MouseHover event below:

Private Sub grdData_MouseHover(ByVal sender As Object, ByVal e As
System.EventArgs) Handles grdData.MouseHover
Me.ToolTip1.SetToolTip(grdData, GetListViewSubItem(grdData,
sender.mouseposition))
End Sub

grdData is the listview control. The subitem index that is shown in the tool
tip seems to be off by one column. It seems to be looking at the column to
the right of the column where the mouse is hovering over. Am I doing
something wrong?

Jack
"J L" wrote:
Hi Jack,
Here is the code someone shared with me previously and I am passing
along to you. I use it extenstively...you should be able to cut and
paste to get it to work.

Structure RECT
Public left As Integer
Public top As Integer
Public right As Integer
Public bottom As Integer
End Structure 'RECT

Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As
IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam
As RECT) As Integer

Public Function GetListViewSubItem(ByVal listView1 As ListView,
ByVal pt As Point) As Integer
Try
'
'***** IMPORTANT ***** The ListView must be set for FullRowSelect!!
'
Const LVM_FIRST As Integer = &H1000
Const LVM_GETSUBITEMRECT As Integer = LVM_FIRST + 56
Const LVIR_BOUNDS As Integer = 0

Dim myrect As RECT
Dim lvitem As ListViewItem = listView1.GetItemAt(pt.X, pt.Y)
If lvitem Is Nothing AndAlso listView1.SelectedItems.Count > 0
Then
lvitem = listView1.SelectedItems(0)
End If
Dim intLVSubItemIndex As Integer = -1
Dim LVSubItem As ListViewItem.ListViewSubItem = Nothing

If Not (lvitem Is Nothing) Then
Dim intSendMessage As Integer
Dim i As Integer
For i = 1 To lvitem.SubItems.Count - 1
LVSubItem = lvitem.SubItems(i)
myrect = New RECT
myrect.top = i
myrect.left = LVIR_BOUNDS
intSendMessage = SendMessage(listView1.Handle,
LVM_GETSUBITEMRECT, lvitem.Index, myrect)
If pt.X < myrect.left Then
LVSubItem = lvitem.SubItems(0)
intLVSubItemIndex = 0
Exit For
ElseIf pt.X >= myrect.left And pt.X <= myrect.right
Then
intLVSubItemIndex = i
Exit For
Else
LVSubItem = Nothing
End If
Next i
End If
If LVSubItem Is Nothing OrElse lvitem Is Nothing Then
intLVSubItemIndex = -1
End If
Return intLVSubItemIndex
Catch ex As Exception
ErrHandler("MarymonteUtilities - GetListViewSubItem", ex)
End Try
End Function
On Mon, 30 May 2005 12:04:03 -0700, "Jack"
<Ja**@discussions.microsoft.com> wrote:
Hello,

I've noticed through searching this group's previous posts that one can get
the item the mouse is over in a listview control but I did not see how to get
the subitem the mouse is over. Is this possible?

I intend on replacing an ActiveX grid with a listview control from a VB6
application that I've upgraded to VB .NET. The existing functionlality uses
the mouseover event of the grid to display specific information within
individual cells of the grid.

Thanks!
Jack


Nov 21 '05 #5
J L
Good news Jack. As to passing back the subitem or the index, I use the
index because I want to access both the item and the column title. So
the index is useful in that case.

John

On Tue, 31 May 2005 16:11:01 -0700, "Jack"
<Ja**@discussions.microsoft.com> wrote:
Nevermind. I was passing in the incorrect Point. I was passing in the
mouseposition of the listview control when I should have been sending in the
x and y coordinates of the event argument as a new point. Here is the code
for anyone with this same issue (I also moved the code to MouseOver from
MouseHover):

Private Sub GridData_MouseMove(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles grdData.MouseMove
Dim lvSubItem As ListViewItem.ListViewSubItem
lvSubItem = GetListViewSubItem(grdData, New Point(e.X, e.Y))
If Not lvSubItem Is Nothing Then
Me.ToolTip1.SetToolTip(grdData, lvSubItem.Text)
Else
Me.ToolTip1.RemoveAll()
End If
End Sub
P.S. I also modified the GetListViewSubItem procedure to pass back the
subitem object instead of the index.

Thanks for you help!!

Jack

"Jack" wrote:
Thank you for the code. I did cut and paste it into a test application and
the coordinates for subitems seems to be off a little bit. I'm calling the
procedure you provided in the MouseHover event below:

Private Sub grdData_MouseHover(ByVal sender As Object, ByVal e As
System.EventArgs) Handles grdData.MouseHover
Me.ToolTip1.SetToolTip(grdData, GetListViewSubItem(grdData,
sender.mouseposition))
End Sub

grdData is the listview control. The subitem index that is shown in the tool
tip seems to be off by one column. It seems to be looking at the column to
the right of the column where the mouse is hovering over. Am I doing
something wrong?

Jack
"J L" wrote:
> Hi Jack,
> Here is the code someone shared with me previously and I am passing
> along to you. I use it extenstively...you should be able to cut and
> paste to get it to work.
>
> Structure RECT
> Public left As Integer
> Public top As Integer
> Public right As Integer
> Public bottom As Integer
> End Structure 'RECT
>
> Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As
> IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam
> As RECT) As Integer
>
> Public Function GetListViewSubItem(ByVal listView1 As ListView,
> ByVal pt As Point) As Integer
> Try
> '
> '***** IMPORTANT ***** The ListView must be set for FullRowSelect!!
> '
> Const LVM_FIRST As Integer = &H1000
> Const LVM_GETSUBITEMRECT As Integer = LVM_FIRST + 56
> Const LVIR_BOUNDS As Integer = 0
>
> Dim myrect As RECT
> Dim lvitem As ListViewItem = listView1.GetItemAt(pt.X, pt.Y)
> If lvitem Is Nothing AndAlso listView1.SelectedItems.Count > 0
> Then
> lvitem = listView1.SelectedItems(0)
> End If
> Dim intLVSubItemIndex As Integer = -1
> Dim LVSubItem As ListViewItem.ListViewSubItem = Nothing
>
> If Not (lvitem Is Nothing) Then
> Dim intSendMessage As Integer
> Dim i As Integer
> For i = 1 To lvitem.SubItems.Count - 1
> LVSubItem = lvitem.SubItems(i)
> myrect = New RECT
> myrect.top = i
> myrect.left = LVIR_BOUNDS
> intSendMessage = SendMessage(listView1.Handle,
> LVM_GETSUBITEMRECT, lvitem.Index, myrect)
> If pt.X < myrect.left Then
> LVSubItem = lvitem.SubItems(0)
> intLVSubItemIndex = 0
> Exit For
> ElseIf pt.X >= myrect.left And pt.X <= myrect.right
> Then
> intLVSubItemIndex = i
> Exit For
> Else
> LVSubItem = Nothing
> End If
> Next i
> End If
> If LVSubItem Is Nothing OrElse lvitem Is Nothing Then
> intLVSubItemIndex = -1
> End If
> Return intLVSubItemIndex
> Catch ex As Exception
> ErrHandler("MarymonteUtilities - GetListViewSubItem", ex)
> End Try
> End Function
>
>
> On Mon, 30 May 2005 12:04:03 -0700, "Jack"
> <Ja**@discussions.microsoft.com> wrote:
>
> >Hello,
> >
> >I've noticed through searching this group's previous posts that one can get
> >the item the mouse is over in a listview control but I did not see how to get
> >the subitem the mouse is over. Is this possible?
> >
> >I intend on replacing an ActiveX grid with a listview control from a VB6
> >application that I've upgraded to VB .NET. The existing functionlality uses
> >the mouseover event of the grid to display specific information within
> >individual cells of the grid.
> >
> >Thanks!
> >Jack
>
>


Nov 21 '05 #6
John, it's a funny thing ... I got to my desk this morning to work on this
project and came across another instance where I need to use the code you
provided. As it turns out, I need the index returned and not just the
subitem. If forgot that the subitem doesn't provide an index to its position
in the item. So, the code is back to where you originally intended it to be.
I should have assumed the decision to send back the subitem or index was well
thought out.

Thanks again. It's a very useful chunk of code.

Jack
"J L" wrote:
Good news Jack. As to passing back the subitem or the index, I use the
index because I want to access both the item and the column title. So
the index is useful in that case.

John

On Tue, 31 May 2005 16:11:01 -0700, "Jack"
<Ja**@discussions.microsoft.com> wrote:
Nevermind. I was passing in the incorrect Point. I was passing in the
mouseposition of the listview control when I should have been sending in the
x and y coordinates of the event argument as a new point. Here is the code
for anyone with this same issue (I also moved the code to MouseOver from
MouseHover):

Private Sub GridData_MouseMove(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles grdData.MouseMove
Dim lvSubItem As ListViewItem.ListViewSubItem
lvSubItem = GetListViewSubItem(grdData, New Point(e.X, e.Y))
If Not lvSubItem Is Nothing Then
Me.ToolTip1.SetToolTip(grdData, lvSubItem.Text)
Else
Me.ToolTip1.RemoveAll()
End If
End Sub
P.S. I also modified the GetListViewSubItem procedure to pass back the
subitem object instead of the index.

Thanks for you help!!

Jack

"Jack" wrote:
Thank you for the code. I did cut and paste it into a test application and
the coordinates for subitems seems to be off a little bit. I'm calling the
procedure you provided in the MouseHover event below:

Private Sub grdData_MouseHover(ByVal sender As Object, ByVal e As
System.EventArgs) Handles grdData.MouseHover
Me.ToolTip1.SetToolTip(grdData, GetListViewSubItem(grdData,
sender.mouseposition))
End Sub

grdData is the listview control. The subitem index that is shown in the tool
tip seems to be off by one column. It seems to be looking at the column to
the right of the column where the mouse is hovering over. Am I doing
something wrong?

Jack
"J L" wrote:

> Hi Jack,
> Here is the code someone shared with me previously and I am passing
> along to you. I use it extenstively...you should be able to cut and
> paste to get it to work.
>
> Structure RECT
> Public left As Integer
> Public top As Integer
> Public right As Integer
> Public bottom As Integer
> End Structure 'RECT
>
> Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As
> IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam
> As RECT) As Integer
>
> Public Function GetListViewSubItem(ByVal listView1 As ListView,
> ByVal pt As Point) As Integer
> Try
> '
> '***** IMPORTANT ***** The ListView must be set for FullRowSelect!!
> '
> Const LVM_FIRST As Integer = &H1000
> Const LVM_GETSUBITEMRECT As Integer = LVM_FIRST + 56
> Const LVIR_BOUNDS As Integer = 0
>
> Dim myrect As RECT
> Dim lvitem As ListViewItem = listView1.GetItemAt(pt.X, pt.Y)
> If lvitem Is Nothing AndAlso listView1.SelectedItems.Count > 0
> Then
> lvitem = listView1.SelectedItems(0)
> End If
> Dim intLVSubItemIndex As Integer = -1
> Dim LVSubItem As ListViewItem.ListViewSubItem = Nothing
>
> If Not (lvitem Is Nothing) Then
> Dim intSendMessage As Integer
> Dim i As Integer
> For i = 1 To lvitem.SubItems.Count - 1
> LVSubItem = lvitem.SubItems(i)
> myrect = New RECT
> myrect.top = i
> myrect.left = LVIR_BOUNDS
> intSendMessage = SendMessage(listView1.Handle,
> LVM_GETSUBITEMRECT, lvitem.Index, myrect)
> If pt.X < myrect.left Then
> LVSubItem = lvitem.SubItems(0)
> intLVSubItemIndex = 0
> Exit For
> ElseIf pt.X >= myrect.left And pt.X <= myrect.right
> Then
> intLVSubItemIndex = i
> Exit For
> Else
> LVSubItem = Nothing
> End If
> Next i
> End If
> If LVSubItem Is Nothing OrElse lvitem Is Nothing Then
> intLVSubItemIndex = -1
> End If
> Return intLVSubItemIndex
> Catch ex As Exception
> ErrHandler("MarymonteUtilities - GetListViewSubItem", ex)
> End Try
> End Function
>
>
> On Mon, 30 May 2005 12:04:03 -0700, "Jack"
> <Ja**@discussions.microsoft.com> wrote:
>
> >Hello,
> >
> >I've noticed through searching this group's previous posts that one can get
> >the item the mouse is over in a listview control but I did not see how to get
> >the subitem the mouse is over. Is this possible?
> >
> >I intend on replacing an ActiveX grid with a listview control from a VB6
> >application that I've upgraded to VB .NET. The existing functionlality uses
> >the mouseover event of the grid to display specific information within
> >individual cells of the grid.
> >
> >Thanks!
> >Jack
>
>


Nov 21 '05 #7

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

Similar topics

1
by: Mark Doggett | last post by:
Hi I have a listview control with four columns. The problem I have is that the second column needs to display an image but as it is a subitem this doesn't appear to be able to be done. Does...
1
by: kuphryn | last post by:
Hello How do you append/set subitem within a row For example given this listview 0 1 2 3 4 1 2 3 In row 2, I'd like to add "5" after the "4." Class ListView supports adding a new row via...
0
by: Andrew | last post by:
If item is a ListViewItem and str is a string, why do the following two lines not have the same effect ? item.SubItems.Add(new ListViewItem.ListViewSubItem()).Text = str;...
0
by: Samuel R. Neff | last post by:
I'm having a index problem with ListView SubItems. If I add multiple columns to the listview and then add items with associated subitems, the ListView displays fine. Then if I delete a column via...
0
by: Prem S | last post by:
Hi All I am trying to tab through the subitems of a ListView control...but everytime I try and tab through the subitems, the control ends up highlighting the full row. I have turned the...
0
by: Jack | last post by:
Hello all, In code, I'm updating the text property of subitems in a Listview which is in Details view. This may be a dumb question, but I can't seem to find a good way to refresh the listview to...
9
by: Martin | last post by:
On each Listview item I can add one or more so called sub-items. These subitems appear to be little more than labels. I'm curious if I could add something else as a subitem, for instance a textbox...
10
by: Adam Honek | last post by:
This is probably a silly question but oh well, I can't find the answer looking via code. Having an imagelist already, how does one set an icon for a list view's sub items? I'm using the code...
2
by: MikeY | last post by:
Hi everyone, After reading various posts I'm still scratching my head and unsure of what approach to take. I have created buttons that upon clicking, the buttons add an item name (myName) to my...
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.