diff options
| author | AShifter <[email protected]> | 2017-09-25 09:35:03 -0600 |
|---|---|---|
| committer | AShifter <[email protected]> | 2017-09-25 09:35:03 -0600 |
| commit | f5004702c46d6c99737a0519d7d6735307c7501a (patch) | |
| tree | 66be901284162cbadb10af1495e7b88fe00a24ca /ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs | |
| parent | f77811b2a73512db8c5aeeedd573640e10b74bd0 (diff) | |
| parent | 44d8d5c50749b70e93dd5ccf8718645d8c3d2fad (diff) | |
| download | shiftos-rewind-f5004702c46d6c99737a0519d7d6735307c7501a.tar.gz shiftos-rewind-f5004702c46d6c99737a0519d7d6735307c7501a.tar.bz2 shiftos-rewind-f5004702c46d6c99737a0519d7d6735307c7501a.zip | |
Merge remote-tracking branch 'refs/remotes/ShiftOS-Rewind/master'
Diffstat (limited to 'ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs')
| -rw-r--r-- | ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs new file mode 100644 index 0000000..175d1cb --- /dev/null +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using ShiftOS.Engine.WindowManager; + +namespace ShiftOS.Main.ShiftOS.Apps +{ + public partial class SelectColor : UserControl + { + ShiftWM shiftWM = new ShiftWM(); + Color finalColor; + int colorType1; + int colorType2; + int colorType3; + public SelectColor() + { + InitializeComponent(); + + } + + private void btnSetColor_Click(object sender, EventArgs e) + { + try + { + colorType1 = Convert.ToInt32(textBox1.Text); + colorType2 = Convert.ToInt32(textBox2.Text); + colorType3 = Convert.ToInt32(textBox3.Text); + } + catch + { + shiftWM.StartInfoboxSession("Error!", "Cannot parse a string.", InfoboxTemplate.buttonType.OK); + } + + if (colorType1 > 255 || colorType2 > 255 || colorType3 > 255) + { + shiftWM.StartInfoboxSession("Error!", "A value cannot be greater than 255!", InfoboxTemplate.buttonType.OK); + } + else + { + try + { + ShiftWindow sw = new ShiftWindow(); + finalColor = Color.FromArgb(colorType1, colorType2, colorType3); + this.BackColor = finalColor; + shiftWM.StartInfoboxSession("Success!", "Changed color to:\n" + colorType1.ToString() + ", " + colorType2.ToString() + ", " + colorType3.ToString() + ".", InfoboxTemplate.buttonType.OK); + } + catch (Exception ex) + { + shiftWM.StartInfoboxSession("Error!", "An exception occured while setting the color! Exception: \n" + ex, InfoboxTemplate.buttonType.OK); + } + } + } + } +} |
