C
C
cigo2020-04-27 13:43:02
C++ / C#
cigo, 2020-04-27 13:43:02

How to disable Ctrl+C, Alt F4 and other CONSOLE close buttons?

C#
console
There are many solutions for FORMS on the Internet, I have not seen it for the console

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
twobomb, 2020-04-27
@twobomb

Console.CancelKeyPress += (sender, args) =>
            {
                args.Cancel = true;
            };

PS On alt F4, in theory, it should not close

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question