//protected override void OnElementChanged(ElementChangedEventArgs<Label> e) //{ // base.OnElementChanged(e); // if (e.NewElement == null) // { // this.GenericMotion -= HandleGenericMotion; // this.Touch -= HandleTouch; // } // if (e.OldElement == null) // { // this.GenericMotion += HandleGenericMotion; // this.Touch += HandleTouch; // } //} protected override void OnElementChanged(ElementChangedEventArgs <Label> e) { base.OnElementChanged(e); if (e.NewElement != null) { label = e.NewElement as FancyLabel; UpdateEventHandlers(); } }
public static Page GetMainPage () { var fancyLabel = new FancyLabel { Text = "Hello, Forms!", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; var tapGestureRecognizer = new TapGestureRecognizer (); tapGestureRecognizer.Tapped += (sender, e) => Console.WriteLine ("Tapped"); fancyLabel.GestureRecognizers.Add (tapGestureRecognizer); return new ContentPage { Content = fancyLabel }; }
public static Page GetMainPage() { var fancyLabel = new FancyLabel { Text = "Hello, Forms!", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += (sender, e) => Console.WriteLine("Tapped"); fancyLabel.GestureRecognizers.Add(tapGestureRecognizer); return(new ContentPage { Content = fancyLabel }); }
protected async void onMouseDown(object o, MouseEventArgs e) { Label tb = (Label) Controls.Find("console", true)[0]; switch (((Control) o).Name) { case "optionInput_Help": Form helpForm = new Form(); helpForm.AutoSize = true; helpForm.Location = tempUsername.Location; FancyLabel help = new FancyLabel(); help.Text = "WCN Quick Help"; help.Font = loginUsername.Font; help.AutoSize = true; helpForm.Controls.Add(help); FancyLabel message = new FancyLabel(); message.Text = "Hello. Welcome to WCN File Manager by David (Hugs)."; message.Text += "\nYou can drag a background image onto the program to replace the default one."; message.Text += "\nSometimes large images will make scrolling laggier."; message.Text += "\nYou can scroll through images using the bottom bar."; message.Text += "\nClicking closer to the left will move left, and clicking closer to the right will move right."; message.Text += "\nYou can change how hovering over images behaves with the hover mode option."; message.Text += "\nThe bg style option cycles through background image size modes."; message.Text += "\nIt may take awhile for all images to load when scrolling. Once loaded it will be smooth."; message.Text += "\nDownloaded images can be viewed by using the open folder option."; message.Text += "\nYou can add music to the music folder and it will cycle through playing them. You can use the next button as well."; message.Text += "\nThis program remembers every setting you choose and stores in %appdata%."; message.Text += "\nThank you for trying WCN File Manager BETA."; message.Font = tb.Font; message.Location = new Point(help.Location.X, help.Location.Y + 5 + help.Height); message.AutoSize = true; helpForm.Controls.Add(message); helpForm.Visible = true; break; case "optionInput_HoverMode": if (!globalSettings.ContainsKey("HoverMode")) { globalSettings["HoverMode"] = "No"; } else { string hover = globalSettings["HoverMode"]; globalSettings["HoverMode"] = hover.Equals("Yes") ? "No" : "Yes"; } tb.Text += "\n[ -> ] hover preview set to " + globalSettings["HoverMode"]; break; case "optionInput_PlayMusic": case "ControlPlay": if ((int) wmp.playState != (int) WMPLib.WMPPlayState.wmppsPlaying) { if (wmp.URL.Equals("") || wmp.URL == null) { wmp = new WindowsMediaPlayer(); wmp.PlayStateChange += new WMPLib._WMPOCXEvents_PlayStateChangeEventHandler(playStateChange); string[] filez = Directory.GetFiles(filePath + "/Music/", "*.*"); if (filez.Length == 0) { wmp.URL = "http://f.worldscolli.de/mlpas.mp3"; } else { wmp.URL = filez[new Random().Next(filez.Length)]; } } wmp.controls.play(); globalSettings["PlayMusic"] = "Yes"; naturalEnding = true; tb.Text += "\n[ -> ] playing " + wmp.currentMedia.name; } break; case "optionInput_ShittyComputerMode": if (shittyComputerMode) { globalSettings["ShittyComputerMode"] = "No"; } else { globalSettings["ShittyComputerMode"] = "Yes"; } MessageBox.Show("The program needs to restart in order for this to take effect.\nYou will have to manually open it again."); Application.Exit(); break; case "optionInput_MultiSelect": if (!globalSettings.ContainsKey("MultiSelect")) { globalSettings["MultiSelect"] = "No"; } string value = globalSettings["MultiSelect"]; globalSettings["MultiSelect"] = value.Equals("Yes") ? "No" : "Yes"; if (globalSettings["MultiSelect"].Equals("Yes")) { ((Control)o).BackColor = Color.Purple; } else { ((Control)o).BackColor = Color.Transparent; } break; case "optionInput_ResetBackground": backgroundBack.Load(loggedIn ? "http://i.imgur.com/78jicHm.jpg" : "http://i.imgur.com/LvoiQw6.gif"); bgChanged = false; globalSettings.Remove("BGPath"); backgroundBack.SizeMode = PictureBoxSizeMode.StretchImage; currentBG = (Bitmap)backgroundBack.Image.Clone(); tb.Text += "\n[ -> ] background reset to default"; break; case "ControlPause": wmp.controls.pause(); globalSettings["PlayMusic"] = "No"; tb.Text += "\n[ -> ] paused " + wmp.currentMedia.name; break; case "ControlStop": naturalEnding = false; wmp.controls.stop(); globalSettings["PlayMusic"] = "No"; tb.Text += "\n[ -> ] stopped " + wmp.currentMedia.name; break; case "ControlNext": naturalEnding = false; wmp.controls.stop(); wmp = new WindowsMediaPlayer(); wmp.PlayStateChange += new WMPLib._WMPOCXEvents_PlayStateChangeEventHandler(playStateChange); string[] files = Directory.GetFiles(filePath + "/Music/", "*.*"); if (files.Length == 0) { wmp.URL = "http://f.worldscolli.de/mlpas.mp3"; } else { wmp.URL = files[new Random().Next(files.Length)]; } naturalEnding = true; tb.Text += "\n[ -> ] playing " + wmp.currentMedia.name; break; case "optionInput_BGStyle": PictureBoxSizeMode[] pb = new PictureBoxSizeMode[] { PictureBoxSizeMode.CenterImage, PictureBoxSizeMode.Normal, PictureBoxSizeMode.StretchImage, PictureBoxSizeMode.Zoom }; string currSetting = globalSettings["BGStyle"]; for (int i = 0; i < pb.Length; i++) { if (pb[i].ToString().Replace(" ", "").Equals(currSetting)) { int x = i + 1; if (x >= pb.Length) { x = 0; } globalSettings["BGStyle"] = pb[x].ToString().Replace(" ", ""); backgroundBack.SizeMode = pb[x]; break; } } tb.Text += "\n[ -> ] changing bg style to " + backgroundBack.SizeMode.ToString(); break; case "PictureOptionCopy to Clipboard": Clipboard.SetText(clickedImage.Name); tb.Text += "\n[ -> ] copied to clipboard"; break; case "PictureOptionSet as Desktop": if (clickedImage.Text.Equals("")) { BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += (b, w) => { Wallpaper.Set(clickedImage.Name, Wallpaper.Style.Fill); }; bw.RunWorkerAsync(); tb.Text += "\n[ -> ] changing wallpaper"; } else { tb.Text += "\n[ -> ] error setting wallpaper"; } ((Control)o).Enabled = false; break; case "PictureOptionDownload": if (multi.Count() == 0) { multi.Add(clickedImage); } foreach (FancyLabel dl in multi) { string[] nameSplit = dl.Name.Split('/'); WebClient client = new WebClient(); client.DownloadFileAsync(new Uri(dl.Name), filePath + "/Download/" + nameSplit[nameSplit.Length - 1]); ((Control)o).Enabled = false; client.DownloadFileCompleted += (a, b) => { tb.Text += "\n[ -> ] download of " + nameSplit[nameSplit.Length - 1] + " complete"; ((Control)o).Text = "Download"; }; client.DownloadProgressChanged += (a, b) => { tb.Text += "\n[ -> ] downloading: " + b.ProgressPercentage + "%"; ((Control)o).Text = nameSplit[nameSplit.Length - 1] + ": " + b.ProgressPercentage + "%"; }; } break; case "PictureOptionOpen": if (multi.Count() == 0) { multi.Add(clickedImage); } foreach (FancyLabel l in multi) { System.Diagnostics.Process.Start(l.Name); } break; case "PictureOptionDelete": if (multi.Count() == 0) { multi.Add(clickedImage); } foreach (FancyLabel l in multi) { string apiUrl = "http://files.worldscolli.de/api/remove"; var client = new HttpClient(); var values = new Dictionary<string, string>() { {"client_id", globalSettings["ClientID"]}, {"path", l.Name.Replace(@"http://f.worldscolli.de/", "")} }; var content = new FormUrlEncodedContent(values); try { var response = await client.PostAsync(apiUrl, content); response.EnsureSuccessStatusCode(); } catch (Exception botchedPost) { MessageBox.Show(botchedPost.Message); } //string apiUrl = "http://files.worldscolli.de/api/remove?client_id=" + globalSettings["ClientID"] + "&path=" + l.Name.Replace(@"f.worldscolli.de/", ""); // HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apiUrl); fullImages.Remove(l.Name); thumbs.Remove(l.Name); backgroundBack.Controls.Remove(l); } int xAmt = 0; int yAmt = 0; int yRows = 0; foreach (string pic in thumbs.Keys) { FancyLabel leb = (FancyLabel) Controls.Find(pic, true)[0]; leb.Location = new Point(10 + xAmt, tempUsername.Location.Y - 80 + yAmt); yAmt += 40 + leb.Height; yRows++; if (yRows == 3) { yAmt = 0; yRows = 0; xAmt += 40 + leb.Width; } } multi.Clear(); onMouseDown(Controls.Find("PictureOptionCancel", true)[0], e); break; case "PictureOptionCancel": viewingImage = false; FancyLabel black = (FancyLabel)Controls.Find("black", true)[0]; foreach (string s in new string[] { "Copy to Clipboard", "Open", "Download", "Set as Desktop", "Delete", "Cancel" }) { Controls.Find("PictureOption" + s, true)[0].Visible = false; Controls.Find("PictureOption" + s, true)[0].Enabled = false; } backgroundBack.Image = currentBG; foreach (Control c in previousVisible) { c.Visible = true; c.Enabled = true; } clickedImage.BorderStyle = BorderStyle.None; previousVisible.Clear(); for (int i = 200; i >= 0; i -= 10) { black.BackColor = Color.FromArgb(i, 0, 0, 0); if (!shittyComputerMode) { await Task.Delay(10); } } black.Visible = false; foreach (FancyLabel l in multi) { l.BorderStyle = BorderStyle.None; } multi = new List<FancyLabel>(); break; default: try { ((FancyLabel)o).Select(); ((FancyLabel)o).Text = ""; if (((FancyLabel)o).Name.Equals("loginPassword")) { password = ""; } } catch (Exception ee) { } break; case "optionInput_LobbyMusicURL": OpenFileDialog file = new OpenFileDialog(); file.InitialDirectory = (filePath).Replace("/", "\\"); file.RestoreDirectory = true; file.AutoUpgradeEnabled = true; file.Title = "WCN File Manager"; file.ShowDialog(); break; } }
private void initSetting(String name, String text, String optionName, String settingValue) { FancyLabel option = new FancyLabel(); option.Name = optionName; option.Text = text; option.AutoSize = true; option.Location = new Point(250 + settings, Controls.Find("console", true)[0].Location.Y); option.BackColor = Color.Transparent; option.ForeColor = Color.White; option.Visible = true; backgroundBack.Controls.Add(option); option.BringToFront(); option.Font = new Font("Lithos Pro Regular", 11); defaultFancyLabels.Add(option.Name, option.Text); if (settingValue.Equals("MultiSelect")) { if (globalSettings["MultiSelect"].Equals("Yes")) { option.BackColor = Color.Purple; } } if (settingValue.Equals("ShittyComputerMode")) { if (globalSettings["ShittyComputerMode"].Equals("Yes")) { option.BackColor = Color.Purple; } } Control cont = (Control)option; cont.KeyPress += new KeyPressEventHandler(onKeyPress); cont.MouseDown += new MouseEventHandler(onMouseDown); cont.LostFocus += new EventHandler(onLabelLoseFocus); cont.MouseEnter += new EventHandler(focusGained); cont.MouseLeave += new EventHandler(focusLost); settings += option.Width + 10; }
private void loadEffects(FancyLabel backup, string pic) { WebClient wc; byte[] bFile; MemoryStream ms; Image img; try { wc = new WebClient(); wc.Proxy = null; bFile = wc.DownloadData(getThumb(pic)); ms = new MemoryStream(bFile); img = Image.FromStream(ms); thumbs.Add(backup.Name, (Bitmap) img); backup.Text = ""; } catch (Exception botchedThumb) { wc = new WebClient(); wc.Proxy = null; bFile = wc.DownloadData("http://i.imgur.com/IoOBdm1.png"); ms = new MemoryStream(bFile); img = Image.FromStream(ms); //backup.Image = img; thumbs.Add(backup.Name, (Bitmap)img); } }
private void loadCollection() { int xAmt = 0; int yAmt = 0; int yRows = 0; List<FancyLabel> pics = new List<FancyLabel>(); foreach (string pic in list) { FancyLabel leb = new FancyLabel(); leb.Visible = false; leb.Name = pic; leb.ImageAlign = ContentAlignment.MiddleCenter; leb.Text = "\n\n\n\n\n\n" + pic.Split('.')[pic.Split('.').Length - 1]; leb.ForeColor = Color.Black; leb.BackColor = Color.Transparent; leb.TextAlign = ContentAlignment.TopCenter; leb.Font = new Font("Lithos Pro Regular", 9); leb.Location = new Point(10 + xAmt, tempUsername.Location.Y - 80 + yAmt); leb.Size = new Size(100, 100); leb.Parent = backgroundBack; leb.MouseEnter += new EventHandler(pictureZoom); leb.MouseLeave += new EventHandler(unZoom); leb.MouseClick += new MouseEventHandler(pictureClick); backgroundBack.Controls.Add(leb); pics.Add(leb); yAmt += 40 + leb.Height; yRows++; if (yRows == 3) { yAmt = 0; yRows = 0; xAmt += 40 + leb.Width; } } Label tb = (Label)Controls.Find("console", true)[0]; tb.Text += "\n[ -> ] loading " + pics.Count + " files"; int i = 0; foreach (FancyLabel pb in pics) { BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += (o, w) => { loadEffects(pb, pb.Name); }; worker.RunWorkerCompleted += (o, w) => { Invoke((MethodInvoker)delegate { render(pb, pb.Location.Y); }); }; worker.RunWorkerAsync(); } }
private async void pictureClick(object o, MouseEventArgs e) { if (!viewingImage || globalSettings["MultiSelect"].Equals("Yes")) { FancyLabel leb = (FancyLabel)o; if (globalSettings["MultiSelect"].Equals("No")) { if (fullImages.ContainsKey(leb.Name)) { backgroundBack.Image = fullImages[leb.Name]; } else if (leb.Text.Equals("") || leb.Text == null) { backgroundBack.Image = loading.Image; BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += (b, w) => { WebClient client = new WebClient(); /*client.DownloadProgressChanged += (cl, lc) => { lc.ProgressPercentage };*/ try { byte[] bFile = client.DownloadData(leb.Name); MemoryStream ms = new MemoryStream(bFile); Image img = Image.FromStream(ms); fullImages.Add(leb.Name, (Bitmap)img); } catch (Exception eee) { } }; bw.RunWorkerCompleted += (b, w) => { if (clickedImage.Name.Equals(leb.Name) && viewingImage) { Invoke((MethodInvoker)delegate { backgroundBack.Image = fullImages[leb.Name]; }); } }; bw.RunWorkerAsync(); } } if (globalSettings["MultiSelect"].Equals("Yes")) { if (leb.BorderStyle == BorderStyle.Fixed3D) { multi.Remove(leb); leb.BorderStyle = BorderStyle.None; return; } else { multi.Add(leb); } } viewingImage = true; clickedImage = leb; leb.BorderStyle = BorderStyle.Fixed3D; Control console = Controls.Find("console", true)[0]; int yAmt = 0; Control[] ctrl = Controls.Find("black", true); FancyLabel black; if (ctrl.Count() == 0) { black = new FancyLabel(); black.BackColor = Color.FromArgb(0, 0, 0, 0); black.Size = Size; black.Visible = true; black.Name = "black"; black.Parent = backgroundBack; black.Location = new Point(0, 0); backgroundBack.Controls.Add(black); } else { black = (FancyLabel) ctrl[0]; } black.Visible = true; black.BringToFront(); leb.BringToFront(); menu.BringToFront(); if (globalSettings["MultiSelect"].Equals("Yes")) { opacity.BringToFront(); foreach (Control cc in backgroundBack.Controls) { if (cc.Name.Contains("worlds")) { cc.BringToFront(); } } } foreach (string s in new string[] { "Copy to Clipboard", "Open", "Download", "Set as Desktop", "Delete", "Cancel" }) { Control[] ctrls = Controls.Find("PictureOption" + s, true); if (ctrls.Count() == 0) { FancyLabel option = new FancyLabel(); option.Name = "PictureOption" + s; option.AutoSize = true; option.Font = new Font("Lithos Pro Regular", 17); option.Location = new Point(console.Location.X + 10, 200 - yAmt); option.Parent = backgroundBack; option.BackColor = Color.Purple; option.ForeColor = Color.White; option.Text = s; option.Visible = true; option.Enabled = true; backgroundBack.Controls.Add(option); option.BringToFront(); yAmt += 10 + option.Size.Height; Control cont = (Control)option; cont.MouseDown += new MouseEventHandler(onMouseDown); cont.LostFocus += new EventHandler(onLabelLoseFocus); cont.MouseEnter += new EventHandler(focusGained); cont.MouseLeave += new EventHandler(focusLost); } else { ctrls[0].Visible = true; ctrls[0].Enabled = true; ctrls[0].BringToFront(); } } Controls.Find("PictureOptionDelete", true)[0].Text = "Delete"; if (multi.Count() <= 1) { for (int i = 5; i <= 200; i += 10) { black.BackColor = Color.FromArgb(i, 0, 0, 0); if (!shittyComputerMode) { await Task.Delay(10); } } } } }
private async void Form1_Load(object sender, EventArgs e) { filePath = "C:/Users/" + Environment.UserName + "/AppData/Roaming/WCNFileManager"; Opacity = 0; loading.Load("http://i.imgur.com/LXsNAQB.jpg"); if (!Directory.Exists(filePath)) { Directory.CreateDirectory(filePath); Directory.CreateDirectory(filePath + "/Music/"); Directory.CreateDirectory(filePath + "/Download/"); Directory.CreateDirectory(filePath + "/System/"); } if (!File.Exists(filePath + "/settings.wcn")) { var myFile = File.Create(filePath + "/settings.wcn"); myFile.Close(); } loginUsername = new FancyLabel() { Size = tempUsername.Size, Location = tempUsername.Location, Text = "username", Font = new Font("Lithos Pro Regular", 24), BackColor = Color.Transparent, ForeColor = tempUsername.ForeColor, Visible = true, Parent = backgroundBack, TextAlign = ContentAlignment.TopCenter, Name = "loginUsername", BorderStyle = tempUsername.BorderStyle }; loginPassword = new FancyLabel() { Size = tempPassword.Size, Location = tempPassword.Location, Text = "********", Font = new Font("Lithos Pro Regular", 24), BackColor = Color.Transparent, ForeColor = tempPassword.ForeColor, Visible = true, Parent = backgroundBack, TextAlign = ContentAlignment.TopCenter, Name = "loginPassword", BorderStyle = tempPassword.BorderStyle }; defaultFancyLabels.Add("loginUsername", "username"); defaultFancyLabels.Add("loginPassword", "********"); backgroundBack.Controls.Add(loginUsername); backgroundBack.Controls.Add(loginPassword); AllowDrop = true; updateSettings(); if (globalSettings.ContainsKey("BGPath")) { try { backgroundBack.Image = new Bitmap(globalSettings["BGPath"]); backgroundBack.SizeMode = (PictureBoxSizeMode)Enum.Parse(typeof(PictureBoxSizeMode), globalSettings["BGStyle"], true); } catch (Exception botchedPath) { backgroundBack.Load(!shittyComputerMode ? "http://i.imgur.com/LvoiQw6.gif" : "http://i.imgur.com/78jicHm.jpg"); MessageBox.Show("Error setting BG:\n" + botchedPath.Message); } } else { backgroundBack.Load(!shittyComputerMode ? "http://i.imgur.com/LvoiQw6.gif" : "http://i.imgur.com/78jicHm.jpg"); backgroundBack.SizeMode = PictureBoxSizeMode.StretchImage; } backgroundBack.Size = Size; wcn.Parent = backgroundBack; backgroundBack.BackColor = Color.Transparent; loginUsername.Visible = true; loginPassword.Visible = true; loginUsername.Parent = backgroundBack; loginPassword.Parent = backgroundBack; foreach (FancyLabel option in new FancyLabel[]{ loginUsername, loginPassword }) { Control cont = (Control)option; cont.KeyPress += new KeyPressEventHandler(onKeyPress); cont.MouseDown += new MouseEventHandler(onMouseDown); cont.LostFocus += new EventHandler(onLabelLoseFocus); cont.MouseEnter += new EventHandler(focusGained); cont.MouseLeave += new EventHandler(focusLost); } Control cc = (Control)opacity; cc.LostFocus += new EventHandler(onLabelLoseFocus); cc.MouseEnter += new EventHandler(focusGained); cc.MouseLeave += new EventHandler(focusLost); this.DoubleBuffered = true; this.BackColor = Color.Black; Label tb = new Label(); tb.Name = "console"; Controls.Add(tb); tb.Location = backgroundBack.Location; tb.Size = new Size(backgroundBack.Size.Height - loginUsername.Size.Height - 2, backgroundBack.Size.Width); tb.BackColor = Color.Transparent; tb.ForeColor = Color.White; tb.Text = "[ <- ] requesting boot information"; tb.Text += "\n[ -> ] system is ready\n[ -> ] dropping mixtape"; tb.Text += shittyComputerMode ? "\n[ -> ] shitty computer mode enabled" : "\n[ -> ] hd mode enabled"; tb.Visible = true; tb.BringToFront(); tb.Parent = backgroundBack; tb.TextChanged += new EventHandler(textChangedOnConsole); loginUsername.KeyPress += new KeyPressEventHandler(loginUsername_KeyPress); loginPassword.KeyPress += new KeyPressEventHandler(loginUsername_KeyPress); showSettings(); if (!shittyComputerMode) { wmp.settings.mute = true; wmp.PlayStateChange += new WMPLib._WMPOCXEvents_PlayStateChangeEventHandler(playStateChange); if (globalSettings.ContainsKey("PlayMusic") && globalSettings["PlayMusic"].Equals("Yes")) { string[] filez = Directory.GetFiles(filePath + "/Music/", "*.*"); if (filez.Length == 0) { wmp.URL = "http://f.worldscolli.de/mlpas.mp3"; } else { wmp.URL = filez[new Random().Next(filez.Length)]; } wmp.settings.mute = false; } } if (globalSettings.ContainsKey("Username")) { loginUsername.Text = globalSettings["Username"]; defaultFancyLabels["loginUsername"] = globalSettings["Username"]; } if (!shittyComputerMode) { int amt = 0; foreach (FancyLabel l in new FancyLabel[] { new FancyLabel() { Name = "ControlPlay" }, new FancyLabel() { Name = "ControlPause" }, new FancyLabel() { Name = "ControlStop" }, new FancyLabel() { Name = "ControlNext" } }) { l.Location = new Point(1100 + amt, Controls.Find("console", true)[0].Location.Y); l.AutoSize = true; l.Text = l.Name.Replace("Control", ""); l.Font = new Font("Lithos Pro Regular", 11); l.BackColor = Color.Transparent; l.ForeColor = Color.White; l.Parent = backgroundBack; Control cont = (Control)l; cont.MouseDown += new MouseEventHandler(onMouseDown); cont.LostFocus += new EventHandler(onLabelLoseFocus); cont.MouseEnter += new EventHandler(focusGained); cont.MouseLeave += new EventHandler(focusLost); backgroundBack.Controls.Add(l); l.Visible = true; l.BringToFront(); amt += l.Width + 10; defaultFancyLabels[l.Name] = l.Text; } } currentBG = new Bitmap((Bitmap)backgroundBack.Image.Clone()); opacity.Parent = backgroundBack; opacity.Visible = true; opacity.BringToFront(); for (double d = 0; d <= 1; d += 0.01) { Opacity += d; await Task.Delay(40); } if (globalSettings.ContainsKey("ClientID")) { if (!bgChanged) { backgroundBack.Load("http://i.imgur.com/78jicHm.jpg"); currentBG = (Bitmap)backgroundBack.Image.Clone(); } login(); } }