9
Answers

Button highlighting on tabstop

John Luciani

John Luciani

12y
3.7k
1
Hi,
   I am designing a c# program in Visual Studio.  This program is a fitness tracker for persons with disabilities, specifically Down Syndrome.  All of the buttons within the program are accessed by means of a simplified keyboard consisting of the arrow buttons, tab button, and enter.  
   What I am looking to do is make it so that when you arrow over to a specific button, it will change color so that the user can tell exactly where they are within the program or rows of buttons.  I do not have the option to use a mouse but have seen the feature for mouseover which allows one to do what I am looking to do.
   The simplest solution would be better as we have a delivery date for this project of May 7th.
Thanks kindly,
John
Answers (9)
0
Vulpes

Vulpes

NA 98.3k 1.5m 10y
Accepted
1
Niranjan Poddar

Niranjan Poddar

NA 308 39.7k 10y
try this........

 public static string ConvertNumbertoWords ( int number )
    {
        if ( number == 0 )
            return "Zero";
        if ( number < 0 )
            return "minus" + ConvertNumbertoWords ( Math.Abs ( number ) );

        string words = "";
        if ( ( number / 1000000 ) > 0 )
        {
            words += ConvertNumbertoWords ( number / 1000000 ) + " MILLION ";
            number %= 1000000;
        }
        if ( ( number / 1000 ) > 0 )
        {
            words += ConvertNumbertoWords ( number / 1000 ) + " THOUSAND ";
            number %= 1000;
        }
        if ( ( number / 100 ) > 0 )
        {
            words += ConvertNumbertoWords ( number / 100 ) + " HUNDRED ";
            number %= 100;
        }
        if ( number > 0 )
        {
            if ( words != "" )
                words += "AND ";
            var unitsMap = new[] { "ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN", "ELEVEN", "TWELVE", "THIRTEEN",
                "FOURTEEN", "FIFTEEN", "SIXTEEN", "SEVENTEEN", "EIGHTEEN", "NINETEEN" };
            var tensMap = new[] { "ZERO", "TEN", "TWENTY", "THIRTY", "FORTY", "FIFTY", "SIXTY", "SEVENTY", "EIGHTY", "NINETY" };

            if ( number < 20 )
                words += unitsMap[number];
            else
            {
                words += tensMap[number / 10];
                if ( ( number % 10 ) > 0 )
                    words += " " + unitsMap[number % 10];
            }
        }
        return words;

    }
    protected void btnConvert_Click1 ( object sender, EventArgs e )
    {
        string word = ConvertNumbertoWords ( Convert.ToInt32 ( txtFig.Text ) );
        lblWord.Text = word;
    }