Pārlūkot izejas kodu

根据线程标识停止线程状态

wb_han 4 gadi atpakaļ
vecāks
revīzija
14df9ea9a2
2 mainītis faili ar 4 papildinājumiem un 3 dzēšanām
  1. 2 1
      ExtenderControl/Extender.csproj
  2. 2 2
      HOZProject/FormHOZMain.cs

+ 2 - 1
ExtenderControl/Extender.csproj

@@ -9,9 +9,10 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>Extender</RootNamespace>
     <AssemblyName>Extender</AssemblyName>
-    <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <Deterministic>true</Deterministic>
+    <TargetFrameworkProfile />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>

+ 2 - 2
HOZProject/FormHOZMain.cs

@@ -149,7 +149,7 @@ namespace HOZProject
         void CompletedWork(object sender, RunWorkerCompletedEventArgs e)
         {
             //设置控件操作
-            MessageBox.Show("线程已完成!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+            MessageBox.Show("测量已完成!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             SetWinControlMeasureState(true);
         }
         #endregion
@@ -315,7 +315,7 @@ namespace HOZProject
             {
                 if (m_Ms != null)
                 {
-                    if (!m_Ms.key_stop)
+                    if (m_BackgroundWorker.IsBusy)
                     {
                         if (MessageBox.Show("当前测量正在运行,是否关闭此窗体?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                         {