LinkLabel - AutoEllipsis on and automatic tooltip  
Author Message
Shannon Broskie





PostPosted: Windows Forms General, LinkLabel - AutoEllipsis on and automatic tooltip Top

I wanted someone to confirm this for me before I go nuts.

If I put a LinkLabel on a standard form, set AutoEllipsis to true and AutoSize to false and make the Text of the LinkLabel larger than the supplied region, the text is shown with an ellipsis and a tooltip will automatically appear with the entire text when the pointer is over the control.

If I do the same on a UserControl instead of a standard form, the tooltip does not automatically appear when the text is too large.

Is this by design I'm assuming that the standard form might be supplying addional services to the LinkLabel control.

I wouldn't be so up in arms about this but, I have LinkLabels in UserControls and they do not automatically tooltip so I have to figure out when an ellipsis is being applied to the text of the label which doesn't seem to be to much of an exact science using MeasureString. It would be nice if the LinkLabel had an event or property telling you that an ellipsis is being displayed.

Thanks for any input.



Windows Forms2  
 
 
bb35





PostPosted: Windows Forms General, LinkLabel - AutoEllipsis on and automatic tooltip Top

Is there somethig special about your user-control I've tried this with a simple user control, having only a link-label on it, and it works for me.

 
 
Shannon Broskie





PostPosted: Windows Forms General, LinkLabel - AutoEllipsis on and automatic tooltip Top

I thought it might be that also.

I then tried then following using VS2005:

- Create a new Windows Control Library (Mine is C#)

- Drop a LinkLabel on the user control and set the following:

-- Autosize = false

-- AutoEllipsis = true

-- Text = Something greater than the size allowed by label

- Run this (TestContainer will host).

No ToolTip.

This is the same thing that happens on my usercontrol. Indeed though if I place that newly created usercontrol on a form it tooltips properly.

In my case, I have a linklabel user control with a textbox. Upon clicking the link or hitting enter, the link label turns itself into the text for editing and afterwards back to the label. I place this usercontrol in another usercontrol that contains the actual UI. The UI is in a usercontrol because sometimes it needs to be hosted directly in an app and other times the app needs to host the usercontrol in its own form. Maybe it is the combination of two usercontrols on top of each other that causes this. I guessing so since the tooltip does not work in the TestContainer either.

Thanks for your input.


 
 
Peter Huang - MSFT





PostPosted: Windows Forms General, LinkLabel - AutoEllipsis on and automatic tooltip Top

Hi Shannon,

Thanks for your posting!
I can reproduce the issue with the steps that the TestContainer will not popup the Tooltip, but if we host the UserControl on the Winform the tooltip is OK.

Since the TestContainer is for test only, did you have any special concern about use the UserControl on the Winform

Also I have also test the scenario below.
LinkLabel on UserControl1
UserControl1 on UserControl2
UserControl2 on Windows form,
And the Tooltip is OK.

I am somewhat confused by the last paragraph of your question, if I misunderstood, please feel free to post here.

If you still have any concern, please feel free to post here.

Best regards,
Peter Huang



 
 
Shannon Broskie





PostPosted: Windows Forms General, LinkLabel - AutoEllipsis on and automatic tooltip Top

Thanks again for your assistance Peter. I will have to figure out why my tooltip is not coming through properly on the two user controls. You are correct in you test scenario so it must be something configured on possibly my second user control.

Basically, my first UserControl is a LinkLabel and a TextBox/ComboBox. The user can click on the LinkLabel and the appropriate editor will show in its place (either TextBox or Lookup via the ComboBox). This control is just to give the forms a smoother 'textual' feel to them instead of having TextBoxes and ComboBoxes everywhere. The control behaves properly when losing focus or hitting escape and enter keys as to whether the changes are posted back to the LinkLabel.

The second UserControl uses this LinkLabel among others. This was made as a UserControl to facilitate the hosting of this interface as embedded in the actual application or shown in a separate popup form. It will also allow other apps to host the UserControl so my applications can share their functionality.

I'm guessing I might have something going on with the second UserControl that is causing my tooltips from my LinkLabel in my first UserControl to not pop up.

I will continue to investigate and will post back here if I find my cause.

Thanks again for your testing.


 
 
Peter Huang - MSFT





PostPosted: Windows Forms General, LinkLabel - AutoEllipsis on and automatic tooltip Top

Hi Shannon,

Just want to say Hi, and I was wondering how everything is going.

If you still have any concern, please feel free to post here.

Best regards,
Peter Huang



 
 
JasonBSteele





PostPosted: Windows Forms General, LinkLabel - AutoEllipsis on and automatic tooltip Top

Hi,

I can confirm that this happens for me also.

I have a user control which contains a label with AutoEllipses=True. At runtime I create instances of the user control and populate a panel with them.

If I hover over the label a tooltip doesnot appear.

Regards,

Jason