Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

ToolTip in vb6 ListView?
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



Report this thread to moderator Post Follow-up to this message
Old Post
Brian McCullough
09-25-04 01:55 AM


Re: ToolTip in vb6 ListView?
Brian 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..

Report this thread to moderator Post Follow-up to this message
Old Post
Ken Halter
09-25-04 01:55 AM


Re: ToolTip in vb6 ListView?
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...
> 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..



Report this thread to moderator Post Follow-up to this message
Old Post
Brian McCullough
09-25-04 01:55 AM


Re: ToolTip in vb6 ListView?
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...
> 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... 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Bryan Dickerson
09-25-04 01:55 AM


Re: ToolTip in vb6 ListView?
I 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..



Report this thread to moderator Post Follow-up to this message
Old Post
Brian McCullough
09-25-04 01:55 AM


Re: ToolTip in vb6 ListView?
I 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? 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Brian McCullough
09-25-04 01:55 AM


Re: ToolTip in vb6 ListView?
"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




Report this thread to moderator Post Follow-up to this message
Old Post
MikeD
09-25-04 01:55 AM


Re: ToolTip in vb6 ListView?
How 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
>



Report this thread to moderator Post Follow-up to this message
Old Post
Brian McCullough
09-25-04 01:55 AM


Re: ToolTip in vb6 ListView?
Brian 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..

Report this thread to moderator Post Follow-up to this message
Old Post
Ken Halter
09-25-04 01:55 AM


Re: ToolTip in vb6 ListView?
Bryan, 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 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
MikeD
09-25-04 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

Visual Basic archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:22 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.