MissionPlanner.Common.LoadingBox C# (CSharp) Method

LoadingBox() public static method

public static LoadingBox ( string title, string promptText ) : Form
title string
promptText string
return System.Windows.Forms.Form
        public static Form LoadingBox(string title, string promptText)
        {
            Form form = new Form();
            System.Windows.Forms.Label label = new System.Windows.Forms.Label();
            System.ComponentModel.ComponentResourceManager resources =
                new System.ComponentModel.ComponentResourceManager(typeof(MainV2));
            form.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));

            form.Text = title;
            label.Text = promptText;

            label.SetBounds(9, 50, 372, 13);

            label.AutoSize = true;

            form.ClientSize = new Size(396, 107);
            form.Controls.AddRange(new Control[] { label });
            form.ClientSize = new Size(Math.Max(300, label.Right + 10), form.ClientSize.Height);
            form.FormBorderStyle = FormBorderStyle.FixedDialog;
            form.StartPosition = FormStartPosition.CenterScreen;
            form.MinimizeBox = false;
            form.MaximizeBox = false;

            ThemeManager.ApplyThemeTo(form);

            form.Show();
            form.Refresh();
            label.Refresh();
            Application.DoEvents();
            return form;
        }

Usage Example

Ejemplo n.º 1
0
        public ElevationProfile(List <PointLatLngAlt> locs, double homealt)
        {
            InitializeComponent();

            planlocs = locs;

            if (planlocs.Count <= 1)
            {
                CustomMessageBox.Show("Please plan something first", "Error");
                return;
            }

            // get total distance
            distance = 0;
            PointLatLngAlt lastloc = null;

            foreach (PointLatLngAlt loc in planlocs)
            {
                if (lastloc != null)
                {
                    distance += (int)loc.GetDistance(lastloc);
                }
                lastloc = loc;
            }

            this.homealt = homealt / MainV2.comPort.MAV.cs.multiplierdist;

            Form frm = Common.LoadingBox("Loading", "Downloading Google Earth Data");

            gelocs = getGEAltPath(planlocs);

            frm.Close();
        }
All Usage Examples Of MissionPlanner.Common::LoadingBox