| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using System.Runtime.InteropServices;
- using System.Diagnostics;
- namespace Lecall
- {
- public partial class frmUpdateMsg : Form
- {
- public frmUpdateMsg()
- {
- InitializeComponent();
- }
- /// <summary>
- /// 更新信息字符串
- /// </summary>
- public string Msg = "";
- #region 拖动无窗体控件
- [DllImport("user32.dll")]//*********************拖动无窗体的控件
- public static extern bool ReleaseCapture();
- [DllImport("user32.dll")]
- public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
- public const int WM_SYSCOMMAND = 0x0112;
- public const int SC_MOVE = 0xF010;
- public const int HTCAPTION = 0x0002;
- #endregion
- #region 拖拽窗体
- private void pnlTop_MouseDown(object sender, MouseEventArgs e)
- {
- ReleaseCapture();
- SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);//调用移动无窗体控件函数
- }
- #endregion
- /// <summary>
- /// 界面初始化
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void frmUpdateMsg_Load(object sender, EventArgs e)
- {
- SetMsg();
- }
- private void SetMsg()
- {
- string[] messageLines = Msg.Split('#');
- for (int i = 0; i < messageLines.Length; i++)
- {
- this.richtxtBoxMsg.AppendText(messageLines[i].ToString()+"\n");
- }
- }
- /// <summary>
- /// 关闭窗体
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void picClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 确定更新事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSubmit_Click(object sender, EventArgs e)
- {
- Process p = new Process();
- p.StartInfo.FileName = Application.StartupPath + @"\Update.exe";
- p.Start();
- this.Close();
- }
- /// <summary>
- /// 取消更新
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- }
- }
|