Code Comments
Programming Forum and web based access to our favorite programming groups.Hello all, Is there a way to display a ToolTip in a VB6 ListView when the mouse is idle for a second or two? I would like similar functionality as the Windows Explorer panel which displays information about an item if the mouse stays over it for a second or so (i.e. the file attributes). Thanks in advance! Brian
Post Follow-up to this messageBrian McCullough wrote: > Hello all, > > Is there a way to display a ToolTip in a VB6 ListView when the mouse is id le > for a second or two? > > I would like similar functionality as the Windows Explorer panel which > displays information about an item if the mouse stays over it for a second > or so (i.e. the file attributes). > > Thanks in advance! > > Brian Each ListItem/ListSubItem has a ToolTipText property... '============== Private Sub Form_Load() Dim i As Integer With ListView1 .View = lvwReport .ColumnHeaders.Add , , "Item" .ColumnHeaders.Add , , "SubItem" For i = 1 To 10 With .ListItems.Add .Text = "Item " & i .ToolTipText = "Here's the tooltip for " & .Text With .ListSubItems.Add .Text = "SubItem " & i .ToolTipText = "Here's the tooltip for " & .Text End With End With Next End With End Sub '============== -- Ken Halter - MS-MVP-VB - http://www.vbsight.com Please keep all discussions in the groups..
Post Follow-up to this messageThanks Ken,
For some reason, I do not have the ToolTipText available to me!?!?!?
Do While Not rs.EOF
With lvClientNotes.ListItems.Add(,
CStr(rs.Fields.Item("NoteId").Value) & "K", rs.Fields.Item("Type").Value &
"")
.SubItems(1) =
RTrim(rs.Fields.Item("LastModUser").Value) & ""
.SubItems(2) =
Format(rs.Fields.Item("LastModDate").Value, "mm/dd/yyyy")
.SubItems(3) = Replace(rs.Fields.Item("Note").Value,
vbCrLf, " ") & ""
.ToolTipText = rs.Fields.Item("Note").Value & ""
'<----does not work!
End With
rs.MoveNext
Loop
rs.Close
Also, is there a way to allow the columns to display "thicker" than 1 row?
Thanks again!
Brian
"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
news:eRhhpGnoEHA.2588@TK2MSFTNGP12.phx.gbl...
> Brian McCullough wrote:
>
> Each ListItem/ListSubItem has a ToolTipText property...
> '==============
> Private Sub Form_Load()
> Dim i As Integer
> With ListView1
> .View = lvwReport
> .ColumnHeaders.Add , , "Item"
> .ColumnHeaders.Add , , "SubItem"
> For i = 1 To 10
> With .ListItems.Add
> .Text = "Item " & i
> .ToolTipText = "Here's the tooltip for " & .Text
> With .ListSubItems.Add
> .Text = "SubItem " & i
> .ToolTipText = "Here's the tooltip for " & .Text
> End With
> End With
> Next
> End With
> End Sub
> '==============
>
>
> --
> Ken Halter - MS-MVP-VB - http://www.vbsight.com
> Please keep all discussions in the groups..
Post Follow-up to this messageRead thru his code again. He doesn't use the .Subitems property, he uses
the .ListSubItems collection for each Item. Each item under that has a
.Text and a .ToolTip property.
"Brian McCullough" <nomorespammingme@myemailaddress.com> wrote in message
news:ufqY$NnoEHA.3488@TK2MSFTNGP12.phx.gbl...
> Thanks Ken,
>
> For some reason, I do not have the ToolTipText available to me!?!?!?
>
> Do While Not rs.EOF
> With lvClientNotes.ListItems.Add(,
> CStr(rs.Fields.Item("NoteId").Value) & "K", rs.Fields.Item("Type").Value &
> "")
> .SubItems(1) =
> RTrim(rs.Fields.Item("LastModUser").Value) & ""
> .SubItems(2) =
> Format(rs.Fields.Item("LastModDate").Value, "mm/dd/yyyy")
> .SubItems(3) = Replace(rs.Fields.Item("Note").Value,
> vbCrLf, " ") & ""
> .ToolTipText = rs.Fields.Item("Note").Value & ""
> '<----does not work!
> End With
>
> rs.MoveNext
> Loop
> rs.Close
>
>
> Also, is there a way to allow the columns to display "thicker" than 1
row?
>
> Thanks again!
>
> Brian
>
> "Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
> news:eRhhpGnoEHA.2588@TK2MSFTNGP12.phx.gbl...
>
>
Post Follow-up to this messageI have the columns set during design time. I also have the View set to lvReport during design time. Don't know if this makes a difference. "Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message news:eRhhpGnoEHA.2588@TK2MSFTNGP12.phx.gbl... > Brian McCullough wrote: > > Each ListItem/ListSubItem has a ToolTipText property... > '============== > Private Sub Form_Load() > Dim i As Integer > With ListView1 > .View = lvwReport > .ColumnHeaders.Add , , "Item" > .ColumnHeaders.Add , , "SubItem" > For i = 1 To 10 > With .ListItems.Add > .Text = "Item " & i > .ToolTipText = "Here's the tooltip for " & .Text > With .ListSubItems.Add > .Text = "SubItem " & i > .ToolTipText = "Here's the tooltip for " & .Text > End With > End With > Next > End With > End Sub > '============== > > > -- > Ken Halter - MS-MVP-VB - http://www.vbsight.com > Please keep all discussions in the groups..
Post Follow-up to this messageI was using an older version of the ListView control. "Bryan Dickerson" <txprphan@netscape.net> wrote in message news:%23ZsCbSnoEHA.516@TK2MSFTNGP09.phx.gbl... > Read thru his code again. He doesn't use the .Subitems property, he uses > the .ListSubItems collection for each Item. Each item under that has a > .Text and a .ToolTip property. > > "Brian McCullough" <nomorespammingme@myemailaddress.com> wrote in message > news:ufqY$NnoEHA.3488@TK2MSFTNGP12.phx.gbl... > row? > >
Post Follow-up to this message
"Brian McCullough" <nomorespammingme@myemailaddress.com> wrote in message
news:ufqY$NnoEHA.3488@TK2MSFTNGP12.phx.gbl...
> Thanks Ken,
>
> For some reason, I do not have the ToolTipText available to me!?!?!?
> .ToolTipText = rs.Fields.Item("Note").Value & ""
> '<----does not work!
Are you getting a "Method or data member not found" compile-time error? If
so, are you sure you're using the VB6 version of Windows Common Controls?
The VB5 version does not have this property for a ListView control. If
you're not getting this error, then explain "does not work". That could
mean anything.
Mike
Post Follow-up to this messageHow can i automatically set the width of the columns in a vb6 listview control? Brian "Brian McCullough" <nomorespammingme@myemailaddress.com> wrote in message news:%23VSA3BnoEHA.3552@TK2MSFTNGP15.phx.gbl... > Hello all, > > Is there a way to display a ToolTip in a VB6 ListView when the mouse is > idle for a second or two? > > I would like similar functionality as the Windows Explorer panel which > displays information about an item if the mouse stays over it for a second > or so (i.e. the file attributes). > > Thanks in advance! > > Brian >
Post Follow-up to this messageBrian McCullough wrote: > How can i automatically set the width of the columns in a vb6 listview > control? > > Brian See: Autosizing ListView Columns via API http://vbnet.mvps.org/index.html?co...umnautosize.htm -- Ken Halter - MS-MVP-VB - http://www.vbsight.com Please keep all discussions in the groups..
Post Follow-up to this messageBryan, perhaps you need to look through Brian's code again. <g> Brian's code is using ToolTipText of a ListItem object (not how I would have done it [using a With block on the Add method of ListItems], but a ListItem object nonetheless). Mike "Bryan Dickerson" <txprphan@netscape.net> wrote in message news:%23ZsCbSnoEHA.516@TK2MSFTNGP09.phx.gbl... > Read thru his code again. He doesn't use the .Subitems property, he uses > the .ListSubItems collection for each Item. Each item under that has a > .Text and a .ToolTip property. > > "Brian McCullough" <nomorespammingme@myemailaddress.com> wrote in message > news:ufqY$NnoEHA.3488@TK2MSFTNGP12.phx.gbl... & > row? is which > >
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.