How to add a background with C#codes?

Asked

Viewed 72 times

-1

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Wellsoft{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine("Software for Wellsoft Games");
            //Valores Inteiros (int)
            int num_1 = 936;
            int num_2 = 5298;
            int num_3 = 323;
            Console.ForegroundColor = ConsoleColor.Magenta;
            Console.WriteLine("Existe " + num_1 + " onlines em nosso site, " + num_2 + " acesso por dia, é " + num_3 + " membros na equipe.");
            Console.ForegroundColor = ConsoleColor.White;
        }

    }
}

Note: This code has no elements to add the image, I just put to better understand.

  • Do you want to add an image to a console application? How do you expect it to work? Do you understand what a console is?

  • Not yet, because I’m new to C#, I started 3 days ago, barely know the tool Visual Studio.

1 answer

1

This is not possible, the most you can do is change the background color and there is a trick to change the whole background and not just the line, but it implies to run a Console.Clear().

class Program
{
    static void Main(string[] args)
    {
        Console.BackgroundColor = ConsoleColor.DarkGray;
        Console.ForegroundColor = ConsoleColor.White;
        Console.Clear();

        Console.ReadLine();

    }
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.