Skip to content

Commit

Permalink
添加:
Browse files Browse the repository at this point in the history
WIN7系统首次开启GUI,程序将自动识别系统;
修复:
修复进度条显示BUG。
  • Loading branch information
cmliu committed Oct 15, 2024
1 parent f8020d9 commit a712e22
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 13 deletions.
12 changes: 7 additions & 5 deletions Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 31 additions & 6 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ public Form1()
comboBox3.DropDownStyle = ComboBoxStyle.DropDownList;
GetLocalIPs();

this.Height = 492;
//this.Height = 492;
this.Width = 816;

// 设置窗体为固定大小
this.FormBorderStyle = FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = true; // 保留最小化功能
FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);
Expand Down Expand Up @@ -387,7 +386,7 @@ private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
comboBox2.Text = "amd64";
this.Height = 522;
}

进度条坐标修正();
}
private void textBox1_Leave(object sender, EventArgs e)
{
Expand Down Expand Up @@ -627,6 +626,15 @@ private void LoadFromIni()
{
// 退出程序
Environment.Exit(0); // 立即退出程序
}
else
{
var version = Environment.OSVersion.Version;
if (version.Major == 6 && version.Minor == 1)
{
Console.WriteLine("当前系统是 Windows 7");
comboBox1.Text = "windows7";
}
}
}
}
Expand Down Expand Up @@ -712,14 +720,15 @@ private void RemoveFromStartup()

private void timer1_Tick(object sender, EventArgs e)
{
timer1.Enabled = false;
Check_COLO(sender, e);
button3_Click(sender, e);
if (checkBox1.Checked)
{
button1_Click(sender, e);
}
timer1.Enabled = false;
this.Height = 492;
进度条坐标修正();
}

private void button3_Click(object sender, EventArgs e)
Expand All @@ -729,15 +738,15 @@ private void button3_Click(object sender, EventArgs e)
button3.Text = "高级设置∧";
//this.Height = 492;
this.Height += 83;
progressBar1.Location = new Point(12, 502);
进度条坐标修正();
}
else
{
groupBox3.Visible = false;
button3.Text = "高级设置∨";
//this.Height = 575;
this.Height -= 83;
progressBar1.Location = new Point(12, 502-83);
进度条坐标修正();
}
}

Expand Down Expand Up @@ -777,6 +786,11 @@ private void outputTextBox_MouseLeave(object sender, EventArgs e)
checkBox4.Checked = true;
}

private void 进度条坐标修正() {
Console.WriteLine("目前进度条坐标:" + progressBar1.Location + "当前窗口坐标" + this.Size.ToString());
progressBar1.Location = new Point(13, this.Size.Height-70);
}

private void Check_COLO(object sender, EventArgs e)
{
// 获取当前程序的目录
Expand Down Expand Up @@ -889,5 +903,16 @@ private async void button4_Click(object sender, EventArgs e)
await StopCommandAsync();
}
}

private void label1_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (progressBar1.Visible == false)
{
progressBar1.Visible = true;
} else
{
progressBar1.Visible = false;
}
}
}
}
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.0.4")]
[assembly: AssemblyFileVersion("0.1.0.4")]
[assembly: AssemblyVersion("0.1.0.5")]
[assembly: AssemblyFileVersion("0.1.0.5")]

0 comments on commit a712e22

Please sign in to comment.