public void showMain_PIP() { this.Opacity = 0; this.Show(); BlueformFrameworkUse.Show(this, 10); Library.str_TextShow = string.Empty; }
private void frmHide() { BlueformFrameworkUse.Hide(this, 10); StateWindow = false; Library.is_openedwindows = false; Library.str_input_save = string.Empty; Library.Show_Close_PoupupMessenging(true); }
private void frmShow() { this.Opacity = 0; this.Show(); BlueformFrameworkUse.Show(this, 10); Library.str_TextShow = string.Empty; Library.str_input_save = string.Empty; Library.is_openedwindows = true; Library.Show_Close_PoupupMessenging(false); }
public static void NewInstanceHandler(object sender, StartupNextInstanceEventArgs e) { // Kích hoạt cửa sổ của instance đang chạy // Bạn có thể thay thế bằng 1 hành động khác if (!Library.is_openedwindows) { Library.is_openedwindows = true; frm.Show(); BlueformFrameworkUse.Show(frm, 10); if (Library.is_Messenging_Start) { Library.Show_Close_PoupupMessenging(false); } } }
public void stopPIP() { tmrunPIP.Stop(); Library.is_PIP = false; PanelMain.Visible = false; Library.setZoomLeverMS(Library.dou_zoomvalueMS); this.Width = Library.int_formWidth; this.Height = Library.int_formHeight; showPanels(true); PanelMain.Width = Library.int_controlWidth; PanelMain.Height = Library.int_controlHeight; PanelMain.Location = new System.Drawing.Point(Library.int_controlLocationX, Library.int_controlLocationY); this.Location = new Point(Library.int_formLocationX, Library.int_formLocationY); this.TopMost = Properties.Settings.Default.FIsShowTop; is_resize = true; Properties.Settings.Default.FPIP = false; Properties.Settings.Default.Save(); this.Hide(); if (winstate) { WindowState = FormWindowState.Maximized; winstate = false; } int i_run = 0; tmrunPIP.Stop(); tmrunPIP = new System.Windows.Forms.Timer(); tmrunPIP.Interval = 200; tmrunPIP.Tick += new EventHandler((object obj, EventArgs e) => { i_run++; if (i_run <= 1) { tmrunPIP.Stop(); PanelMain.Visible = true; BlueformFrameworkUse.Show(this, 10); } }); tmrunPIP.Start(); }
private void ismoveControls() { if (ismove) { if (!isfirsMove) { blureForm.SetSize = this.Size; blureForm.SetLocations = this.Location; blureForm.Intialization(); //blureForm.frmBlueGone.Hide(); this.Focus(); pnClose.Show(); this.Focus(); BlueformFrameworkUse.FormNormal(blureForm.frmBlueGone, 15); } } else { pnClose.Visible = false; BlueformFrameworkUse.FormBlure(blureForm.frmBlueGone, 10); tmwait.Stop(); tmwait = new System.Windows.Forms.Timer(); tmwait.Interval = 170; tmwait.Tick += new EventHandler((object obj, EventArgs e) => { tmwait.Stop(); Aero.DisabledAcrylic(blureForm.frmBlueGone); blureForm.DisponseForm(); GC.Collect(); GC.WaitForPendingFinalizers(); if (isClosetForm) { Show_Close(false); } }); tmwait.Start(); } }
public void startPIP() { //BlueformFrameworkUse.Hide(this, 10); if (WindowState == FormWindowState.Maximized) { winstate = true; this.WindowState = FormWindowState.Normal; } PanelMain.Visible = false; Library.is_PIP = true; is_resize = false; Library.setZoomLeverMS(-1.3); showPanels(false); this.Width = Library.PIPWidth; this.Height = Library.PIPHeight; PanelMain.Width = Library.PIPPanelWidth; PanelMain.Height = Library.PIPPanelHeight; this.StartPosition = FormStartPosition.Manual; this.TopMost = Properties.Settings.Default.FIsPIPTopMost; this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - this.Width, Screen.PrimaryScreen.WorkingArea.Height - this.Height); PanelMain.Location = Properties.Settings.Default.FPIPPanelLocation; this.Hide(); int i_run = 0; tmrunPIP.Stop(); tmrunPIP = new System.Windows.Forms.Timer(); tmrunPIP.Interval = 200; tmrunPIP.Tick += new EventHandler((object obj, EventArgs e) => { i_run++; if (i_run <= 1) { tmrunPIP.Stop(); PanelMain.Visible = true; BlueformFrameworkUse.Show(this, 10); } }); tmrunPIP.Start(); }
private void frmSetting_Load(object sender, EventArgs e) { this.Opacity = 0; BlueformFrameworkUse.Show(this, 10); //string[] arrStrColor = { "Default", "Black", "White", "Silver", "Blue", "Green", "Lime", "Teal", "Orange", "Brown", "Pink", "Magenta", "Purple", "Red", "Yellow" }; //for (int i = 0; i < arrStrColor.Length; i++) //{ // cbbColor.Items.Add(arrStrColor[i]); // cbbColor.Items.IndexOf(i); //} //this.Theme = MetroThemeStyle.Dark; new Thread(() => { try { if (this.InvokeRequired) { this.Invoke((MethodInvoker) delegate { intialize(); }); } else { intialize(); } } catch (Exception ex) { MetroMessageBox.Show(this, "Hệ thống bị lỗi tương thích, hệ thống sẽ khôi phục cài đặt lại cho bạn!\nBạn vui lòng mở lại ứng dụng sau khi khôi phục.\nLỗi: " + ex.Message, "Lỗi !", MessageBoxButtons.OK, MessageBoxIcon.Error); Library.endProcessMain(); Properties.Settings.Default.Reset(); } }) { IsBackground = true }.Start(); }
//public ChromiumWebBrowser browser; private void frmUpdateDownload_Load(object sender, EventArgs e) { BlueformFrameworkUse.Show(this, 10); new Thread(() => { string Path_Location = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).Substring(6); //string thisver = Assembly.GetExecutingAssembly().GetName().Version.ToString(); string thisver = Library.systemversion; try { lblstatus.Text = "Stating.."; progressWork.Value += 20; WebRequest wrsUpdate = WebRequest.Create("https://drive.google.com/uc?authuser=0&id=1Sr_CrZB6dEZVGjLx3KxAUvQzclwDsxGh&export=download"); //64bir // 64bit: https://drive.google.com/uc?authuser=0&id=1Sr_CrZB6dEZVGjLx3KxAUvQzclwDsxGh&export=download // 32bit: https://drive.google.com/uc?authuser=0&id=1o1hX4BK6CU4TXkGefdaTyvVUMHHpwQCI&export=download // test: https://drive.google.com/uc?authuser=0&id=1hTH1a6sc0YitvYVbWZZBpqD61AUWZFqC&export=download Thread.Sleep(200); lblstatus.Text = "Connecting.. \nYour version: " + thisver; progressWork.Value += 30; WebResponse wrpUpdate = wrsUpdate.GetResponse(); lblstatus.Text = "Checking Update.."; progressWork.Value += 30; StreamReader srdUpdate = new StreamReader(wrpUpdate.GetResponseStream()); Thread.Sleep(300); string response = srdUpdate.ReadToEnd(); var reponseStr = response.Split('\n'); string newver = reponseStr[0].Trim(); if (thisver != newver) { if (MetroMessageBox.Show(this, "Version: " + newver + " are ready for download, do you want continue ?", "Question ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { string path = @"D:\Messenger_Update"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } for (int i = 1; i < reponseStr.Length; i++) { var var_in = reponseStr[i].Trim().Split(' '); string filename = var_in[0].Trim(); string filelink = var_in[1].Trim(); lblstatus.Text = i + "/" + (reponseStr.Length - 1) + " Downloading file: " + filename; downloadAPI.DownloadFileFromURLToPath(filelink, @"D:\Messenger_Update\" + filename); lblstatus.Text = "Complete download file: " + filename; Thread.Sleep(300); } lblstatus.Text = "Complete download all file. Waiting for instal!"; progressWork.Value += 20; Thread.Sleep(800); Process.Start(Path.Combine(AppDomain .CurrentDomain.BaseDirectory .SolutionFolder() , Path_Location + @"\ModuleUpdate.exe")); Library.EndProgram(); } else { lblstatus.Text = "Download is cancel!"; progressWork.Value += 20; } } else { progressWork.Value += 20; lblstatus.Text = "Your Application is Updated \nYour version: " + thisver; } Application.ExitThread(); } catch { lblstatus.Text = "Error Can't connect to server, try later\nYour version: " + thisver; } }) { IsBackground = true }.Start(); //th.Join(); //if (is_end) // Application.ExitThread(); //using (WebClient wc = new WebClient()) //{ // wc.DownloadProgressChanged += wc_DownloadProgressChanged; // wc.DownloadFileAsync( // // Param1 = Link of file // new System.Uri("http://www.sayka.com/downloads/front_view.jpg"), // // Param2 = Path to save // "D:\\front_view.jpg" // ); //} }
public void hideMain_PIP() { BlueformFrameworkUse.Hide(this, 10); StateWindow = false; Library.is_openedwindows = false; }