C#C
C#3y ago
170 replies
Name

❔ How to make this program into GUI application?

Hello guys! I have the following code:

 Console.WriteLine("Enter number: ");
int input = Convert.ToInt32(Console.ReadLine());
int a = 0; int b = 0;

while (a <= input)
{
    var mul = a * b;

    if (mul == input)
    {
        if (a > b)
            break;

        Console.WriteLine(a + " x " + b);
    }

    if (b == input)
    {
        b = 0;
        a++;
    }
    else
    {
        b++;
    }
} 


It's for finding all possible multiplications of a given number which the user enters.
For example: if I enter 2, the program shows: 2x1, if I enter 4, it shows 2x2 and 4x1 and so on...

This program works in the C# console application but I want to try to make it work in GUI. My idea is to have 2 textboxes and 1 button. I enter the number in the first textbox and after I press the button, it must show the result in the second textbox.

However, I have never worked with GUI and I don't know what exactly do to. Does anybody have any idea where I should start?
2.JPG
Was this page helpful?