Re: Lebans Tooltip Control : Listbox font size
- From: "Stephen Lebans" <ForEmailGotoMy.WebSite.-WWWdotlebansdot...@xxxxxxxxxxxx>
- Date: Mon, 20 Aug 2007 17:27:56 -0300
Are you working with Access 2003? Prior to 2003(I think), the Tooltips class
works correctly for any size font in the ListBox. I cheated a bit to save
time when calculating the font height for a row in the ListBox. It's my
opnly solution that uses this method and now it is biting me in the ass.
Access 2003, when instantiating the ListBox in the form's Load event, does
not bother to select the font into the ListBox's Device Context. Instead it
creates the DC with the default 8 point font. Honestly, I cannot see me
finding time to correct this for a couple of weeks yet.
To work around this, I need to create a DC myself and select the font into
it that matches the control's Font prop's settings.
As it states in the commented source code, you cannot have any partial or
empty rows at the bottom of your ListBox. You have to size your control to
display full rows.
Finally, you can turn off the column header Tooltip by NOT enabling Column
Headers property in your ListBox control. Just place a couple of Lable
controls as pseudo Column Headers(no support for horizontal scrolling
though.)
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Guy" <gjt@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uxYdJKx4HHA.5852@xxxxxxxxxxxxxxxxxxxxxxx
Stephen
Thank you for your prompt response.
I have found this code and inspected var. values on step through.
m_TotalDisplayedRows = 19 - yet the actual list box in question only has
10 displayed rows (excl. column headers).
Note : I have reset the listbox font size to 8 (default) and the tooltip
text is correct for ALL rows - so the font size does appear to be the
problem -for me at least.....
Also, I note the tooltip graphic displays for the column header and all
space below any valid rows in the listbox....? Can this be prevented?
Thanks
"Stephen Lebans" <ForEmailGotoMy.WebSite.-WWWdotlebansdot...@xxxxxxxxxxxx>
wrote in message news:%23bVOg0w4HHA.5880@xxxxxxxxxxxxxxxxxxxxxxx
Hi Guy,
it does not matter what Font size you use. Have you looked at my Comments
in the source code for this issue?
' Height of Text
' This is not a perfect solution.
' The first row is not as tall as the rest
' of the rows so we will fudge a bit.
' Also you should have the Listbox's last row
' be completely visible. Finally the ListBox must not have
' any empty rows at the bottom of the Control.
m_HeightSingleRow = pt.cy - 1
' Convert pixels to Twips
m_HeightSingleRow = m_HeightSingleRow * (TWIPSPERINCH /
m_ToolTip.ScreenYdpi)
' Now divide the control's height by the height of one row of Text
m_TotalDisplayedRows = m_ListBox.Height \ m_HeightSingleRow
Let me know how you make out.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Guy" <gjt@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:eYT5Cww4HHA.5424@xxxxxxxxxxxxxxxxxxxxxxx
I am using the Lebans '97 tooltip control for adding some richer
functionality to a form on my Access database.
However, I appear to have a problem. My endusers tend not have
particuarly good eyesight and so I have increased the default size of
the list items in the listbox for which I want the Tooltips to appear.
This causes the tooltip code lose its relative row position and so its
displays tooltip text for another row. The longer the list - the larger
the error in the no. rows the text is offset.... apart from reverting to
the default font size - is there a fix for this?
Thank you in advance.
Regards
G
.
- Follow-Ups:
- References:
- Lebans Tooltip Control : Listbox font size
- From: Guy
- Re: Lebans Tooltip Control : Listbox font size
- From: Stephen Lebans
- Re: Lebans Tooltip Control : Listbox font size
- From: Guy
- Lebans Tooltip Control : Listbox font size
- Prev by Date: Re: I can't get my Tables updated automatically by using an input Form
- Next by Date: Re: How to Make a "Clear All Filters" button?
- Previous by thread: Re: Lebans Tooltip Control : Listbox font size
- Next by thread: Re: Lebans Tooltip Control : Listbox font size
- Index(es):
Relevant Pages
|