Here are the examples of the csharp api class System.Windows.Forms.Control.ResetForeColor() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
5 Examples
0
1. Example
Project: PKMN-NTR
Source File: MainForm.cs
Source File: MainForm.cs
private void updateStats() { // Generate the stats. pkm.setStats(pkm.getStats(SAV.Personal.getFormeEntry(pkm.Species, pkm.AltForm))); Stat_HP.Text = pkm.Stat_HPCurrent.ToString(); Stat_ATK.Text = pkm.Stat_ATK.ToString(); Stat_DEF.Text = pkm.Stat_DEF.ToString(); Stat_SPA.Text = pkm.Stat_SPA.ToString(); Stat_SPD.Text = pkm.Stat_SPD.ToString(); Stat_SPE.Text = pkm.Stat_SPE.ToString(); // Recolor the Stat Labels based on boosted stats. { int incr = pkm.Nature / 5; int decr = pkm.Nature % 5; System.Windows.Forms.Label[] labarray = { Label_ATK, Label_DEF, Label_SPE, Label_SPA, Label_SPD }; // Reset Label Colors foreach (System.Windows.Forms.Label label in labarray) label.ResetForeColor(); // Set Colored StatLabels only if Nature isn't Neutral if (incr == decr) return; labarray[incr].ForeColor = Color.Red; labarray[decr].ForeColor = Color.Blue; } }
0
2. Example
Project: PKHeX
Source File: PKMEditor.cs
Source File: PKMEditor.cs
private void UpdateStats() { // Generate the stats. if (!CHK_HackedStats.Checked || pkm.Stat_HPCurrent == 0) // no stats when initially loaded from non-partyformat slot { pkm.SetStats(pkm.GetStats(pkm.PersonalInfo)); LoadPartyStats(pkm); } // Recolor the Stat Labels based on boosted stats. { int incr = pkm.Nature / 5; int decr = pkm.Nature % 5; Label[] labarray = { Label_ATK, Label_DEF, Label_SPE, Label_SPA, Label_SPD }; // Reset Label Colors foreach (Label label in labarray) label.ResetForeColor(); // Set Colored StatLabels only if Nature isn't Neutral if (incr == decr || incr >= labarray.Length) return; labarray[incr].ForeColor = Color.Red; labarray[decr].ForeColor = Color.Blue; } }
0
3. Example
Project: TileIconifier
Source File: SkinnableTabControl.cs
Source File: SkinnableTabControl.cs
private void RefreshTabPageColors(TabPage tabPage) { //We don't touch to the tab pages in design mode to prevent //the designer from setting the property value in the designer //generated file. As a side effect of this check, the designer //preview is not faithful to the actual result. if (DesignMode) return; if (FlatStyle == FlatStyle.Flat) { tabPage.UseVisualStyleBackColor = false; tabPage.BackColor = FlatTabSelectedBackColor; tabPage.ForeColor = FlatTabSelectedForeColor; } else { tabPage.ResetBackColor(); tabPage.ResetForeColor(); tabPage.UseVisualStyleBackColor = true; } }
0
4. Example
Project: PKMN-NTR
Source File: MainForm.cs
Source File: MainForm.cs
private void updateNatureModification(object sender, EventArgs e) { if (sender != CB_Nature) return; int nature = WinFormsUtil.getIndex(CB_Nature); int incr = nature / 5; int decr = nature % 5; System.Windows.Forms.Label[] labarray = { Label_ATK, Label_DEF, Label_SPE, Label_SPA, Label_SPD }; // Reset Label Colors foreach (System.Windows.Forms.Label label in labarray) label.ResetForeColor(); // Set Colored StatLabels only if Nature isn't Neutral NatureTip.SetToolTip(CB_Nature, incr != decr ? $"+{labarray[incr].Text} / -{labarray[decr].Text}".Replace(":", "") : "-/-"); }
0
5. Example
Project: PKHeX
Source File: PKMEditor.cs
Source File: PKMEditor.cs
private void UpdateNatureModification(object sender, EventArgs e) { if (sender != CB_Nature) return; int nature = WinFormsUtil.GetIndex(CB_Nature); int incr = nature / 5; int decr = nature % 5; Label[] labarray = { Label_ATK, Label_DEF, Label_SPE, Label_SPA, Label_SPD }; // Reset Label Colors foreach (Label label in labarray) label.ResetForeColor(); // Set Colored StatLabels only if Nature isn't Neutral NatureTip.SetToolTip(CB_Nature, incr != decr ? $"+{labarray[incr].Text} / -{labarray[decr].Text}".Replace(":", "") : "-/-"); }