Print Page | Close Window

[SOLVED]XAML hypertext underline is sticking

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: MarkupLabel Control
Forum Description: Topics Related to Codejock MarkupLabel Control
URL: http://forum.codejock.com/forum_posts.asp?TID=23197
Printed Date: 19 April 2024 at 4:39am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED]XAML hypertext underline is sticking
Posted By: Lodep59
Subject: [SOLVED]XAML hypertext underline is sticking
Date Posted: 10 November 2016 at 9:39am
http://forum.codejock.com/forum_posts.asp?TID=23193" rel="nofollow - (moved from this topic)
Thanks a lot Oleksandr ! It's clear now :)
Waiting for your samples updated (next version I presume ?).
Another question : can you explain me why the same XAML code produces these two different results in 16.3 and 17.3 ?

http://forum.codejock.com/uploads/4049/2016-11-10_15h33_16.png" rel="nofollow - http://forum.codejock.com/uploads/4049/2016-11-10_15h33_16.png


The hypertext underline is sticking to the text in 17.3, the 16.3 result seems a lot more readable...
Thanks.



Replies:
Posted By: olebed
Date Posted: 10 November 2016 at 11:55am
There many changes between these versions, try to use other font or its properties.


Posted By: Lodep59
Date Posted: 10 November 2016 at 12:41pm
I tried but can't find a suitable font... Do you have one ?

-------------
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)


Posted By: Fredrik
Date Posted: 10 November 2016 at 1:27pm
Originally posted by olebed olebed wrote:

There many changes between these versions, try to use other font or its properties.

... I don't really think the solution here is to use another font. I'd like to continue using Segoe UI in my case... 



-------------
Windows 10, Visual Studio 20157, Toolkit Pro 18.3.0


Posted By: Lodep59
Date Posted: 10 November 2016 at 3:54pm
I agree with you... Any solution ?

-------------
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)


Posted By: Lodep59
Date Posted: 10 November 2016 at 4:55pm
I've tried more than 20 fonts and, for all of them, the underline is stuck to the text...
Oleksandr : can you help me ?


-------------
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)


Posted By: Lodep59
Date Posted: 10 November 2016 at 5:20pm
It seems to be related to GDI+.
See the examples below (note the space aroud the "sender adress" and the fact that the final dot is not positioned correctly when GDI+ is on) :





For my label, ok, I can access the "MarkupContext" object and disable GDI+.
But it seems to be a bug don't you think ?
And, also, for some controls (like taskpanel) I can enable markup but I can't access the markup context object !



-------------
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)


Posted By: agontarenko
Date Posted: 12 November 2016 at 10:13am
Hello Lodep59,

I'm glad to inform you that the issue has been fixed.
As hotfix you can change function as below.

SIZE CXTPMarkupGdiPlusDeviceContext::MeasureString(LPCWSTR lpszText, int nCount) const
{
    SIZE sz = { 0 };

    RectF rc;
    RectF layoutRect(0, 0, 0.0f, 0.0f);

    if (Gdiplus::Ok == m_pGdiPlus->GdipMeasureString(GetGraphics(),
        lpszText, nCount, AccessFont(), &layoutRect,
        m_pGpStringFormat, &rc, 0, 0))
    {
        sz.cx = static_cast<int>(CXTPMathUtils::Round(rc.Width)); //fixed
        sz.cy = static_cast<int>(CXTPMathUtils::Round(rc.Height)); //fixed
    }

    return sz;
}



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net