Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToolTipTitle not fully visible when associated control uses Right-To-Left layout #12604

Open
Syareel-Sukeri opened this issue Dec 9, 2024 · 1 comment
Assignees
Labels
Priority:3 Work that is nice to have
Milestone

Comments

@Syareel-Sukeri
Copy link
Contributor

.NET version

.NET 10 with NET 10.0.100 - alpha.1.24573.1 build

Did it work in .NET Framework?

No

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No, repro in .NET 3.1

Issue description

Current Behavior

If the ToolTipTitle contains fewer than 5 characters, no title will be displayed. For titles with 5 or more characters, some characters will remain hidden.

Image

Expected Behavior

The ToolTip should display correctly, showing both its title and content.

Image

Steps to reproduce

  1. Create a new WinForms .NET application.
  2. Add a ToolTip and a control that supports both RightToLeft and RightToLeftLayout properties, such as TabControl, TrackBar, or DateTimePicker.
  3. Set the IsBalloon property for ToolTip to true and assign a title to the ToolTipTitle property, such as "Hello".
  4. Set the control's RightToLeft property to Yes and its RightToLeftLayout property to True.
  5. Assign the ToolTip on toolTip1 with any text.
  6. Run the application and hover over the control to display the ToolTip.
@Syareel-Sukeri Syareel-Sukeri added the untriaged The team needs to look at this issue in the next triage label Dec 9, 2024
@memoarfaa
Copy link

ToolTip need to Handel WS_EX_LAYOUTRTL

Example

internal class RtlToolTip(IContainer cont) : ToolTip
{
    private const int WS_EX_LAYOUTRTL = 0x00400000;
    private static bool? HasRtlLayout = false;

    public new void SetToolTip(Control control, string? caption)
    {
        HasRtlLayout = (bool?)(control.GetType().GetProperty("RightToLeftLayout")?.GetValue(control, null));
        base.SetToolTip(control, caption);
       
    }
    protected override CreateParams CreateParams
    {
        get
        {
           
            CreateParams cp = base.CreateParams;
            if(HasRtlLayout.Value)
                cp.ExStyle |= WS_EX_LAYOUTRTL;

            return cp;
        }

    }
}

Image

@merriemcgaw merriemcgaw added Priority:3 Work that is nice to have and removed untriaged The team needs to look at this issue in the next triage labels Dec 11, 2024
@merriemcgaw merriemcgaw added this to the Future milestone Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:3 Work that is nice to have
Projects
None yet
Development

No branches or pull requests

4 participants