mainform.cs

来自「gps」· CS 代码 · 共 54 行

CS
54
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using GPSClassLibrary;
namespace GPSGuider
{
    public partial class MainForm : Form
    {
        MapForm form = new MapForm();
        CarForm carForm = new CarForm();
        
        Timer timer1 = new Timer();
        bool running = false;

        Point point = new Point(0, 0);

        Random rand = new Random(DateTime.Now.Second);
        public MainForm()
        {
            InitializeComponent();
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            timer1.Interval = 1000;
            timer1.Enabled = true;
            form.Show();
            form.Text = "客户端地图";
        }

        private void timer1_tick(object sender, EventArgs e)
        {
             GPPI gppi = new GPPI();
             form.SetMapPosition(rand.NextDouble() * 90, LatitudeType.North, rand.NextDouble() * 180, LongitudeType.East, rand.NextDouble() * 5000 - 2500);
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            if (running)
            {
                timer1.Stop();
            }
            else
            {
                timer1.Start();
            }
            running = !running;
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?