我在c#中没有那么先进,而且我做了一些小项目,但是现在我遇到了问题。我做了一个启动画面。一切正常。我使用菜单制作项目,并在菜单中选择不同的变体:加密,Decrpytion和退出。在每一个,我有一个“家”按钮。当我按下按钮时,在每个菜单中,每次都会出现闪屏,我需要等待。它很烦人。我怎样才能设置工作一次(只是当我开始程序)?初始屏幕c#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Soft.Properties;
using System.Threading;
namespace Soft
{
public partial class Meniu : Form
{
public Meniu()
{
Thread t = new Thread(new ThreadStart(SplashStart));
t.Start();
Thread.Sleep(5000);
InitializeComponent();
t.Abort();
}
public void SplashStart()
{
Application.Run(new LOGO());
}
还有一个问题。徽标出现后,程序最小化。有什么建议?
这很愚蠢。当你不得不隐藏你的UI开始很慢的事实时,你只需要*闪屏。你必须隐藏的唯一东西是你在你的代码中放了一个Thread.Sleep()调用,并且它睡得太久。删除该语句。现在删除启动画面,因为你不再需要它了。如果你想让用户知道你是谁,那么添加一个Help + About对话框。 –