locked
Showing Tooltip on Label control when ellipsis is shown due to AutoEllipsis RRS feed

  • Question

  • Hello,

    I have a scenario in which I'd like to display a Tooltip when the user hovers over a Label control with the mouse, but I only want the Tooltip to display if the ellipsis character is shown due to the AutoEllipsis property. The idea is that the entire Label's text would be shown in the Tooltip.

    I am able to get the ellipsis to show up properly as a result of AutoEllipsis, but I can't find any events or properties that I can use to query the Label control to see whether or not it is in "Ellipsis" mode (as a result of the Label being too small to fit the text).

    The documentation seems to allude to something in the Remarks section for the AutoEllipsis property, but it doesn't make sense:

    Set AutoEllipsis to true to display text that extends beyond the width of the Label when the user passes over the control with the mouse. If AutoSize is true, the label will grow to fit the text and an ellipsis will not appear.


    Here, it references something about "...when the user passes over the control with the mouse", which seems to be talking about Tooltip behavior, but there is clearly a problem with what it's trying to say (at least, it's confusing to me).

    Can somebody point me in the right direction here?


    Thank you,

    --Mike
    Wednesday, October 19, 2005 7:16 AM

Answers

  • Hi,

    I guess you can check this by comparing the PreferredWidth property with the Width property of the label. If the PreferredWidth is greater that the width, then the ellipsis would be showing...

     

     

    cheers,

    Paul June A. Domag

    Wednesday, October 19, 2005 7:39 AM