WinForm: Tooltip for disabled Controls

25. Januar 2019

Today I’ve been struggeling to get a tooltip on a deactivated control. Normally if you set the property ‚Enabled‘ to False even the tooltips won’t work.

Thanks to Stackoverflor I’ve been able to get this working. Here is my code:

The parental container of the control needs an EventHandler to listen to the MouseMove-event:

AddHandler GroupBox_Settings_Folders.MouseMove, AddressOf GroupBox_Settings_Folders_MouseMove

There you track if the mouse hovers a disabled control and then retrieve it’s tooltip-text and finally force the tooltip to show up:
Private _CurrentControl As Control
Private Sub GroupBox_Settings_Folders_MouseMove(sender As Object, e As MouseEventArgs)
Dim ctrl As Control = GroupBox_Settings_Folders.GetChildAtPoint(e.Location)
If ctrl IsNot Nothing Then
If Not ctrl.Enabled AndAlso (_CurrentControl Is Nothing OrElse _CurrentControl.Name <> ctrl.Name) Then
If _CurrentControl IsNot Nothing AndAlso _CurrentControl.Name <> ctrl.Name Then
End If
Dim tt As String = ToolTip.GetToolTip(ctrl)

If Not String.IsNullOrWhiteSpace(tt) Then
ToolTip.Show(tt, GroupBox_Settings_Folders, e.Location.X + 13, e.Location.Y + 13)
_CurrentControl = ctrl
End If
End If
If _CurrentControl IsNot Nothing Then ToolTip.Hide(GroupBox_Settings_Folders)
_CurrentControl = Nothing
End If
End Sub

That’s all – works pretty fine for me.


Problems with Internet Explorer (10)11 and ASP.NET

28. November 2013

Recently we’ve received a support request about an issue concerning the DirectSmile Card and Gift Shop. Customers who use IE11 will continously be prompted to log in again when trying to order.

After some investigation (it was more like searching the needle in the haystack) we’ve been able to pin this issue down to a more general problem with Microsofts ASP.NET framework: When Microsoft introduced the new Internet Explorer 11 (and this happened also to the version 10) they have changed the user agent string delivered by the browser to the server. This string will be parsed by the ASP.NET framework to identify the browser and it’s capabilities (eg cookie support). This is also a problem for the document web-preview in DirectSmile Integration Server as the AJAX-calls will fail when using IE11.

Unfortunately the regular expression Microsoft uses for the parsing was not prepared for version 10 and 11 – with version 10 it simply failed that there are now two digits (9 –> 10) written. And with version 11 the whole string has been changed so the complete regular expressions needs to be changed.

So when a shop customer logs in the browser is recognized to not support cookies – therefor the IIS will switch to cookieless session states which result in a URL with an extra session ID. As the membership provider who is in responsibility for managing the logins does not support cookieless sessions, the customer will continously be prompted to log in.

Fortunately there is already a hotfix which will hopefully become part of the regular server updates soon: – you won’t need to update all settings by hand.

So after installing this patch your software should work again for Internet Explorer 11

For more technical details I recommend these nice article from Scott Hanselman:

What really annoys me about the Microsoft Web Platform Installer

20. Dezember 2012

The Microsoft Web Platform Installer is a pretty cool tool: One single program which will help you install all the tools, SDKs, frameworks and software you may need for developing on a Windows computer.

As you may guess I recently got a new machine which needs several of these things to be installed – so first pick is the platform installer.

But there is one single but seriously annoying problem with the installer:

No progress, no duration

No progress, no duration

As you may see there is no real progress bar nor any duration information. You can only guess how long the installation will take. It may take 5 minutes or couple of hours – no real chance to plan to do anything between that.

Fortunately the old machine is still there and I can go on working… or at least write a nice blog article about things which annoy me 😉