Why if i disable my textBox to false, is always equal to true?

Mehdi Bugnard

I work on an application "shell" on the plateform "Windows Phone 8". I'm just trying to disable all my user UI controllers when a command is executed. All controllers buttons work well in "disable" mode, but I do not know why, my controller "TextBox" is still active. This is very annoying because the user can still click the input fields durant an operation treatment :'(

Thank a lot guys ;-)

This is my code where i try to disable and enable after my operation is finish:

//.... Get the controller textBox in my class
ttbxInputShell = new RadTextBox() { Text = (ContentPanel.FindName("ttbx_shell") as RadTextBox).Text };
//....



// Disable Ui
    #region DisableUI
    public void DisableUi()
    {
        Deployment.Current.Dispatcher.BeginInvoke(() =>
        {
            ttbxInputShell.IsEnabled = false;           //No Work
            ttbxInputShell.IsHitTestVisible = false;    //No Work
            ttbxInputShell.IsReadOnly = true;           //No Work

            btnLastCommande.IsEnabled = false;          //Work
            btnHelpCommande.IsEnabled = false;          //Work
            btnExecuteCommande.IsEnabled = false;       //Work
        });

    }
    #endregion

    // Enable Ui
    #region EnableUI
    public void EnableUi()
    {
        Deployment.Current.Dispatcher.BeginInvoke(() =>
        {
            ttbxInputShell.IsEnabled = true;
            ttbxInputShell.IsHitTestVisible = true;
            ttbxInputShell.IsReadOnly = false;

            btnLastCommande.IsEnabled = true; 
            btnHelpCommande.IsEnabled = true; 
            btnExecuteCommande.IsEnabled = true;

        });
    }
    #endregion

XAML CODE

        <TextBox x:Name="ttbx_shell" KeyDown="ttbx_shell_KeyDown_1" GotFocus="ttbx_shell_GotFocus_1"  LostFocus="ttbx_shell_LostFocus_1" TextChanged="ttbx_shell_TextChanged_1" HorizontalAlignment="Stretch" VerticalAlignment="Center" TextWrapping="Wrap" Height="100" Margin="-7,-8,0,0" FontSize="26" Padding="3,6,3,0" Grid.Row="2" FontFamily="dos_font.ttf#Perfect DOS VGA 437 Win" />

        <Button x:Name="btnLastCommande" Content="F1" Grid.Row="2" Margin="231,0,55,0" Grid.ColumnSpan="3" Tap="btnLastCommande_Tap" />
        <Button x:Name="btnHelpCommande" Content="?" Grid.Row="2" Grid.Column="1" Margin="55,0,95,0" Grid.ColumnSpan="3" Tap="btnHelpCommande_Tap"/>
        <Button x:Name="btnExecuteCommande" Grid.Row="2" Grid.Column="2" Content="Enter" Padding="-3" Margin="55,0,-5,0" Grid.ColumnSpan="2" Tap="btnExecuteCommande_Tap"/>
    </Grid>

And this is a picture of my application, where you can find the input is still enbale .. But the buttons is disable:

enter image description here

helb

You enable / disable a control which is not added to your UI. The original control with the name "ttbx_shell" shown in the UI is thus not affected.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how will i disable textbox and enable button when the textbox is equal to true

From Dev

I want to know why my 'login logic' always false condition?

From Dev

Why is my condition always false?

From Dev

Why is my if statement always false?

From Dev

Why is my boolean always true?

From Dev

Why i can't use equal function for 2 string in windows form AP? it's always return False

From Java

Why does !!1=="1" equal true and !!2=="2" equal false?

From Dev

Why does my function always returns false, even if it finds return true before?

From Dev

if always false with equal variables

From Dev

Why does True == True evaluate to True, when {a statement that's equal to True} == True evaluates to false?

From Dev

Why does my condition always evaluate as true?

From Dev

Why is my JavaScript if statement always true?

From Dev

Why is my "if" condition (string comparison) always true?

From Dev

PHP Why my 'if' statement always gives TRUE?

From Dev

Why does my `if(result !== "false")` return true?

From Dev

CouchDB-Why my rerduce is always coming as false ? I am not able to reduce anything properly

From Dev

My code always returns true, even when it should be false

From Dev

Why I getting an "Expression always true" warning?

From Dev

Explaining why false and modulus always equate true in Javascript

From Dev

Disable textbox when two textbox is equal

From Dev

Why should I write !== false instead of ==true?

From Dev

Why should I write !== false instead of ==true?

From Dev

I want to check if textbox value is equal to my specific value

From Dev

Why does 'true' equal $true

From Dev

why is for loop true on equal

From Dev

Why does my ACF custom field return always false or array?

From Java

Why is my ClaimsIdentity IsAuthenticated always false (for web api Authorize filter)?

From Dev

Why is my Receiver for charging status always returning false?

From Dev

Why is @first always false in my handlebars #each loop?

Related Related

  1. 1

    how will i disable textbox and enable button when the textbox is equal to true

  2. 2

    I want to know why my 'login logic' always false condition?

  3. 3

    Why is my condition always false?

  4. 4

    Why is my if statement always false?

  5. 5

    Why is my boolean always true?

  6. 6

    Why i can't use equal function for 2 string in windows form AP? it's always return False

  7. 7

    Why does !!1=="1" equal true and !!2=="2" equal false?

  8. 8

    Why does my function always returns false, even if it finds return true before?

  9. 9

    if always false with equal variables

  10. 10

    Why does True == True evaluate to True, when {a statement that's equal to True} == True evaluates to false?

  11. 11

    Why does my condition always evaluate as true?

  12. 12

    Why is my JavaScript if statement always true?

  13. 13

    Why is my "if" condition (string comparison) always true?

  14. 14

    PHP Why my 'if' statement always gives TRUE?

  15. 15

    Why does my `if(result !== "false")` return true?

  16. 16

    CouchDB-Why my rerduce is always coming as false ? I am not able to reduce anything properly

  17. 17

    My code always returns true, even when it should be false

  18. 18

    Why I getting an "Expression always true" warning?

  19. 19

    Explaining why false and modulus always equate true in Javascript

  20. 20

    Disable textbox when two textbox is equal

  21. 21

    Why should I write !== false instead of ==true?

  22. 22

    Why should I write !== false instead of ==true?

  23. 23

    I want to check if textbox value is equal to my specific value

  24. 24

    Why does 'true' equal $true

  25. 25

    why is for loop true on equal

  26. 26

    Why does my ACF custom field return always false or array?

  27. 27

    Why is my ClaimsIdentity IsAuthenticated always false (for web api Authorize filter)?

  28. 28

    Why is my Receiver for charging status always returning false?

  29. 29

    Why is @first always false in my handlebars #each loop?

HotTag

Archive