I have a problem in this that i want to paas a form in a case that when user pres n then it must go to a form but error arises and not working good and threading is not responding

made in cosmos help please need it
using System;
using Cosmos.Compiler.Builder;
using System.Threading;
using System.Windows.Forms;
namespace IUOS
    class Program
        #region Cosmos Builder logic
        // Most users wont touch this. This will call the Cosmos Build tool
        [STAThread]
        static void Main(string[] args)
            BuildUI.Run();
        #endregion
        // Main entry point of the kernel
        public static void Init()
            var xBoot = new Cosmos.Sys.Boot();
            xBoot.Execute();
            Console.ForegroundColor = ConsoleColor.DarkBlue;
            a:
            Console.WriteLine("------------------------------");
            Console.WriteLine("WELCOME TO THE NEWLY OS MADE BY THE STUDENTS OF IQRA UNIVERSITY!");
            Console.WriteLine("------------------------------");
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("\t _____                                
            Console.WriteLine("\t|     |        |            |        
|            |      |");
            Console.WriteLine("\t|     |        |            |        
|            |      |");
            Console.WriteLine("\t|     |        |            |        
|            |      |");
            Console.WriteLine("\t|     |        |            |        
|            |      |___________");
            Console.WriteLine("\t|     |        |            |        
|            |                  |");
            Console.WriteLine("\t|     |        |            |        
|            |                  |");
            Console.WriteLine("\t|     |        |            |        
|            |                  |");
            Console.WriteLine("\t|     |        |            |        
|            |                  |");
            Console.WriteLine("\t|     |        |            |        
|            |                  |");
            Console.WriteLine("\t|_____|        |____________|         |____________|      ____________");
            string input;
            Console.WriteLine();
            Console.Write("\nAbout OS     : a");
            Console.Write("\nTo Shutdown  : s");
            Console.Write("\nTo Reboot    : r");
            Console.Write("\nStart Windows Normaly : n");
            Console.WriteLine();
            input = Console.ReadLine();
            if (input == "s" || input == "S"){
                Cosmos.Sys.Deboot.ShutDown();
            else
            if (input == "r" || input == "R"){
                Cosmos.Sys.Deboot.Reboot();
            else
            if (input == "a" || input == "A"){
                Console.ForegroundColor = ConsoleColor.DarkBlue;
                Console.Clear();
                Console.WriteLine("\n\n\n-------------------------------------");
                Console.WriteLine("version: DISPLAYS OS VERSION");
                Console.WriteLine("about: DISPLAYS INFO ABOUT ANGRY OS");
                Console.WriteLine("hello or hi: DISPLAYS A HELLO WORLD");
                Console.WriteLine("MESSAGE THAT WAS USED TO TEST THIS OS!!");
                Console.WriteLine("-----------------------------------");
                Console.Write("You Want to know : ");
                input = Console.ReadLine();
                if (input == "version"){
                    Console.WriteLine("--------------------");
                    Console.WriteLine("OS VERSION 0.1");
                    Console.WriteLine("--------------------");
                else
                if (input == "about"){
                    Console.WriteLine("--------------------------------------------");
                    Console.WriteLine("OS IS DEVELOPED BY Qazi Jalil-ur-Rahman & Syed Akber Abbas Jafri");
                    Console.WriteLine("--------------------------------------------");
                Console.Write("Want to go back to the main window");
                Console.Write("\nYes : ");
                string ans = Console.ReadLine();
                if (ans == "y" || ans == "Y")
                    goto a;
                    Thread.Sleep(10000);
                else
                if (input == "n" || input == "N")
                    Thread.Sleep(5000);
                    Console.Clear();
                    for (int i = 0; i <= 0; i++){
                        Console.Write("\n\n\n\n\t\t\t\t\t  ____        ____   ___  
                        Console.Write("\n\t\t|\t\t |  |      |    |     
|   |  | |  |  |");
                        Console.Write("\n\t\t|\t|    |  |----  |    |     
|   |  | |  |  |---");
                        Console.Write("\n\t\t|____|____|  |____  |___ |____  |___|  |    |  |___");
                        Thread.Sleep(500);
                    Thread.Sleep(5000);
                    Console.Clear();
                    BootUserInterface();
                    Console.ReadLine();
//                    Form1 fo = new Form1();
                else{
                    for (int i = 0; i <= 5; i++){
                        Console.Beep();
                        Thread.Sleep(1000);
                        goto a;
            while (true);
        private static void BootUserInterface() {
            Thread t = new Thread(UserInterfaceThread);
            t.IsBackground = true;
            t.SetApartmentState(ApartmentState.STA);
            t.Start();
        private static void UserInterfaceThread(object arg) {
            Form1 frm = new Form1();  // use your own
            Application.Run(frm);
 

Hi
Jalil Cracker,
>>when user pres n then it must go to a form but error arises and not working good and threading is not respondin
Could you post the error information? And which line caused this error?
If you want to show Form1, you can use form.show() method
Form1 frm = new Form1();
frm.Show();
In addition, Cosmos is an acronym for C# Open Source Managed Operating System. This is not Microsoft product.If the issue is related to Cosmos, it would be out of our support. Thanks for your understanding. And you need raise an issue at Cosmos site.
Best regards,
kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

Maybe you are looking for