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

NumericUpDown SelectAllOnFocus doesn't work #2542

Closed
fredericoregateiro opened this issue Jun 9, 2016 · 11 comments
Closed

NumericUpDown SelectAllOnFocus doesn't work #2542

fredericoregateiro opened this issue Jun 9, 2016 · 11 comments
Assignees
Labels
Milestone

Comments

@fredericoregateiro
Copy link
Contributor

What steps will reproduce this issue?

Setting the SelectAllOnFocus="True" property on a NumericUpDown control has no efect, on other and using the Controls:TextBoxHelper.SelectAllOnFocus="True" work as expected, selecting all text.

Expected outcome

Setting the SelectAllOnFocus="True" on a NumericUpDown control should have the same behavior like the Controls:TextBoxHelper.SelectAllOnFocus="True"

Environment

  • MahApps.Metro v1.2.4
  • Windows 10
  • Visual Studio 2013
  • .NET Framework 4.5
@michaelmairegger
Copy link
Contributor

@punker76 I saw that you introduced the SelectAllOnFocus property in NumericUpDown. Wouldn't it be better to remove it, because no other control (also .NET internal controls) has such a property and completely rely on TextBoxHelper.SelectAllOnFocus

@punker76
Copy link
Member

@xxMUROxx I'll look on this

@punker76 punker76 self-assigned this Jun 11, 2016
@punker76 punker76 added this to the 1.3.0 milestone Jun 11, 2016
@punker76 punker76 added the Bug label Jun 22, 2016
@collegedude
Copy link

Hi,
I cannot enable the "select all on focus" for NumericUpDown control, it won't work neither with latest release 1.3 nor 1.4.0-ALPHA026�
<NumericUpDown metro:TextBoxHelper.SelectAllOnFocus="True" SelectAllOnFocus="True"�/>
Do you have any ideas?
Thanks,
collegedude

@punker76
Copy link
Member

punker76 commented Nov 2, 2016

@collegedude You need only metro:TextBoxHelper.SelectAllOnFocus="True" the other one is obsolete. It works at the main demo.

<Controls:NumericUpDown Controls:TextBoxHelper.SelectAllOnFocus="True"
                        ButtonsAlignment="Left"
                        Interval="5"
                        Value="500" />

2016-11-02_15h16_24

@collegedude
Copy link

Hi again,
Thank you! The demo application is in fact working, but not my own application (also with MetroWindow). I will try to reproduce the problem with the demo application...
I have added both, the obsolete property and the TextBoxHelper, just to show that they are both not working.

@Cicciomnz
Copy link

Hello everyone,

i want to say thanks for your effort for this amazing work.
Like @collegedude say, the attached property Controls:TextBoxHelper.SelectAllOnFocus is working fine on the application demo, but i cannot use it in my own applications.

Also, the control won't take focus even if i simply click on it, but just when you click the contained value.

@collegedude
Copy link

collegedude commented Nov 16, 2016

Hello @Cicciomnz,
In my case it works if I add the following line in every UserControl that makes use of the TextBoxHelper:

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
�

In my case it was not enough to have this line in App.xaml or MainWindow.xaml

@Cicciomnz
Copy link

It works! Thanks a lot @collegedude

@punker76
Copy link
Member

@Cicciomnz @collegedude It should also work if this resource is added in App.xaml

@punker76
Copy link
Member

@punker76
Copy link
Member

@Cicciomnz

Also, the control won't take focus even if i simply click on it, but just when you click the contained value.

That's the behavior of all TextBoxHelper stuff like clear button or search button on TextBoxes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

5 participants