1-) C# DEVEXPRESS RMOS -
public void loadingAc()
{
SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
}
public void loadingKapat()
{
SplashScreenManager.CloseForm(false);
}
0-) en basit şekli -> devexpress waitform ekle
try{
myLibrary.loadingAc(this);
rezAktar();
}catch (Exception ex){
RHMesaj.MyMessageError(MyClass, "btnRmosAktar_Click", "",ex);
}
finally{
myLibrary.loadingKapat();
}
public static class myLibrary
{
public static void loadingAc(Form form1)
{
SplashScreenManager.ShowForm(form1, typeof(WaitForm1), true, true, false);
}
public static void loadingKapat()
{
SplashScreenManager.CloseForm(false);
}
}
1-) anlık değişikliği ekranda göstermek için
public void changeWaitForm(int cekilenUrun,int toplamUrun) { string text = cekilenUrun + "/" + toplamUrun+" Cimri"; SplashScreenManager.Default.SetWaitFormDescription(text + " Yükleniyor..."); }
|
|
loading progress panel yapımı
1-) loading progress panel yapımı
progressPanel1.Visible = true;
progressPanel1.Caption = "Lütfen Bekleyiniz...";
progressPanel1.Description = "Yükleniyor...";
2-) splashScreenManager1 ekle sağında küçük ok işaretine tıkla -> add wait form yap -> 1 tane win form oluşacak Solution Explorerdan bakabilirsin. çalıştırmak için ise
private void button3_Click(object sender, EventArgs e)
{
//Open Wait Form
SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
try
{
for (int i = 0; i < 1000; i++)
{
Console.WriteLine(i);
}
}
finally
{
//Close Wait Form
SplashScreenManager.CloseForm(false);
}
}
--> WaitForm1.cs de ise şunları ekle
public WaitForm1()
{
InitializeComponent();
this.progressPanel1.AutoHeight = true;
progressPanel1.Caption = "Lütfen Bekleyiniz";
progressPanel1.Description = "Yükleniyor...";
}
SAĞ ALT TARAFI GİZLENİRSE KAPATMAK AÇILIRSA AÇMAK
public void loadingDes(string mesaj) { try { if(gizlendi) { return; } if (SplashScreenManager.Default == null) { loadingAc(); } SplashScreenManager.Default.SetWaitFormDescription(mesaj); } catch (Exception ex) { } }
bool gizlendi = false; public void loadingHide() { try { gizlendi = true;
if (SplashScreenManager.Default != null && SplashScreenManager.Default.IsSplashFormVisible) { SplashScreenManager.CloseForm(false); } } catch (Exception ex) { // Hata yönetimi burada yapılabilir } }
private void notifyIcon1_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { if (this.Visible == true) { this.Hide(); loadingHide(); } else { gizlendi = false; this.Show(); this.Activate(); } } else if (e.Button == MouseButtons.Right) {
} else {
}
}
private void btnAc_Click(object sender, EventArgs e) { gizlendi = false; this.Show(); this.Activate();
}
|