private void TextBoxProgramName_Enter(object sender, EventArgs e) { if (TextBoxProgramName.ForeColor == Color.DimGray && TextBoxProgramName.Text == "Please enter a name...") { TextBoxProgramName.Clear(); TextBoxProgramName.ForeColor = Color.Black; } }
/// <summary> /// Downloads the users programs (if any) and adds them to the listbox for editing/modification. /// </summary> public void DownloadPrograms(object isDeleted) { // TODO: Encrypt/decrypt programs.xml with the username. DisplayPrograms((bool)isDeleted); // TODO: Maybe enable? //Globals.Variables.Containers.Main.SetStatus("Updating programs list...", 3); // Gets the users programs (if any). if (Network.SubmitData("getprograms")) { ParsePrograms(); } // Adds the users programs (if any) to the listbox on the MainForm. Variables.Forms.Main.PopulatePrograms((bool)isDeleted); // Checks if listboxMyPrograms is empty, if it is, resets all the MyProgramsDefault controls (Incase last program has just been deleted). if (Variables.Forms.Main.MyProgramsCount == 0) { Invoke((MethodInvoker) delegate { LabelProgramName.Text = "Program Name:"; LabelProgramDescription.Text = "Program Description:"; LabelVersion.Text = "Version: 1.0"; TextBoxProgramName.Clear(); TextBoxProgramDescription.Clear(); PictureBoxProgramImage.Image = Resources.DefaultProgramImage; ButtonCreateProgram.Enabled = true; ButtonEditProgram.Enabled = false; ButtonManageProgram.Enabled = false; }); Variables.Containers.Main.SetStatus("Create and manage your programs.", 3); } else { Invoke((MethodInvoker) delegate { ButtonEditProgram.Enabled = true; ButtonManageProgram.Enabled = true; ButtonCreateProgram.Enabled = true; }); } // TODO: Fix this. (Stop CreatButton being disabled after deleting a program). Invoke((MethodInvoker) delegate { Variables.Containers.Main.SetStatus("Create and manage your programs.", 3); }); }