Пример #1
0
        private void ShowList_Click(object sender, EventArgs e)
        {
            var form = new FormBase {
                Text = @"Послідовність співвідношень", ClientSize = Program.ShowListClientSize
            };

            form.ClientSizeChanged += (o, ea) =>
            {
                if (form.WindowState == FormWindowState.Normal)
                {
                    Program.ShowListClientSize = form.ClientSize;
                }
            };
            var textBox = new RichTextBox {
                Multiline                = true,
                WordWrap                 = false,
                Dock                     = DockStyle.Fill,
                ScrollBars               = RichTextBoxScrollBars.Both,
                DetectUrls               = false,
                AcceptsTab               = true,
                ShortcutsEnabled         = true,
                RichTextShortcutsEnabled = true,
                TabIndex                 = 0,
                Lines                    = Hset.List.ToArray(m => "\r\n" + m.Data[1].AbcShift + @"," + m.Data[2].AbcShift + @"  " + m.Data + " = 0")
            };

            form.Controls.Add(textBox);
            form.Show();             //*/ Program.StartForm(form);
        }
Пример #2
0
        public static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            FormBase formLoading = new FormBase
            {
                ControlBox      = true,
                MaximizeBox     = false,
                MinimizeBox     = false,
                WindowState     = FormWindowState.Normal,
                StartPosition   = FormStartPosition.CenterScreen,
                FormBorderStyle = FormBorderStyle.FixedSingle,
                ClientSize      = new Size(256, 128),
                ShowIcon        = true,
                ShowInTaskbar   = false
            };
            Label label = new Label
            {
                AutoSize  = false,
                Dock      = DockStyle.Fill,
                Text      = @"Завантаження ...",
                TextAlign = ContentAlignment.MiddleCenter
            };

            formLoading.Controls.Add(label);
            var t = StartForm(formLoading);

            //Thread.Sleep(10000);
            FormList = new FormEquationList
            {
                StartPosition = FormStartPosition.CenterParent
            };
            FormList.Load += (sender, args) => FormList.Activate();
            try { t.Abort(); }
            catch (System.Security.SecurityException) { }
            catch (ThreadStartException) { }
            Application.Run(FormList);
        }