Powered by Outside
Stories posted under Pinkbike Community blogs are not edited, vetted, or approved by the Pinkbike editorial team. These are stories from Pinkbike users. If a blog post is offensive or violates the Terms of Services, please report the blog to Community moderators.

Code cache

Jan 14, 2010 at 10:19
by Brian Ferguson  
You woundnt know!//Comments
//DataBox should be center screen and always on top,
//and draggable with small fonts

using System.Windows.Forms;

class Theme
private Color _backColor, _ForeColor;
private Font _font;
private string _name;

public Theme(string name, Color backColor, Color foreColor, Font font)
{
_name = name;
_backColor = backColor;
_foreColor = foreColor;
_font = font;
}

public void ApplyTheme(Control control)
{
control.ForeColor = _foreColor;
control.BackColor = _backColor;
control.Font = _font;
}

public void RestoreDefault(Form MainForm, Form consoleForm)
{
mainForm.BackColor = Colors.LightBlue;
mainForm.ForeColor = Colors.White;
mainForm.Font = new Font("Calibri");

consoleForm.BackColor = Colors.Black;
consoleForm.ForeColor = Colors.LimeGreen;
consoleForm.Font = new Font("Consolas"); //or another system syle
}
}

private void MainForm(Object Sender, EventArgs e)
{
Theme softGreen = new Theme("Soft Green", Color.Green, Color.Grey, FontStyle.Calibri;
}
}

private void RestoreDefaultThemes()
{
listBox1.BackColor = Color.LightBlue;
listBox1.ForeColor = Color.White;
textBox1.BackColor = Color.LightBlue;
textBox1.ForeColor = Color.White;
thmDataBox = new Theme("Console", Color.Black, Color.LimeGreen, Fonts.Calibri);
}

private void showDataBox_ButtonClick(Object Sender, EventArgs e)
{
DataBox dataBox = new DataBox(thmDataBox);
DataBox.Show();
}
}

Must Read This Week

0 Comments







Copyright © 2000 - 2026. Pinkbike.com. All rights reserved.
dv65 0.016142
Mobile Version of Website