Skip to content

NumberBox mouse cursor changes to the TextBox's IBeam cursor when mouse moves over icon and button margins #1327

@JohnTasler

Description

@JohnTasler

Describe the bug {#describe-the-bug}

When the mouse is hovering over several areas of the NumberBox which should not appear to be the TextBox editable area , These areas include:

  • Static icon areas, such as the one at the left of the control.
  • Margins of the buttons on the right-side of the control.
  • Padding of the TextBox editable area.

To Reproduce

  1. Run the WPF UI Gallery sample application
  2. Navigate to the Text...NumberBox page
  3. Carefully move the mouse over the areas that should not indicate that they are part of the TextBox editable area.
  4. Notice that that the mouse cursor shows as an IBeam over the areas listed above in Describe the bug

Actual behavior

The mouse cursor shows as an IBeam over the areas listed above in Describe the bug.

Image

Expected behavior

The Cursor property should be Arrow rather than IBeam when the mouse hovers over areas that should not appear to be the TextBox editable area..

Image

OS version

Windows 11 (24H2) 26100.1.amd64fre.ge_release.240331-1435

.NET version

net9.0-windows

WPF-UI NuGet version

3.0.5

Additional context

In the fix, this was difficult to get the template just right, due to the NumberBox being derived from TextBox. Instead, it should be derived from Control and contain a TextBox in its ControlTemplate. In other words, the relationship should be "has a TextBox" instead of "is a TextBox", but, that seems out of scope for this bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions