Flatout Electric
When in doubt flatoutelectric@gmail.com
Toolbox
Button
Properties (Event): Click: buttonName_Click
buttonName.ForeColor = Color.Black;
TextBox
Properties: Behavior (Multiline), Appearance (ScrollBars)
tBoxName.Visible = true;
tBoxName.Text = "string";
Clears prior text then displays string
tBoxName.Text += "string";
Adds string to prior text
tBoxName.AppendText(string);
Adds string to prior text, but prevents scroll movement
CheckBox
Properties (Event): CheckedChanged: checkName_Checked
if (checkName.Checked)
ComboBox
Properties: Behavior (AllowDrop)
Properties: Items (Collection): Add drop down items
cBoxName.Text = "string";
Timer
Add timer to form
Properties (Event Tab): Tick: timer_Tick
timerName.Enabled = true;
PictureBox
pBoxName.Visible = true;
Chart (Plots)
Edit chart type via Properties: Chart: Series (Collection)
Edit axis info. via Properties: Chart: ChartAreas (Collection)
Sub-menu Properties: Axes (Collection): X/Y axis
Title, Scale: Min/Max, MajorGrid: Interval
ChartName.Series["Data"].Points.AddXY(x,y);
Functions (General)
Print to console
console.log(`Text Description: ${variable}`);
console.log("Text Description: " + variable); // alt. way
Initialize string to null
string LocalString = String.Empty;
String is not empty
if (!string.IsNullOrEmpty(LocalString))
String contains sub-string
if (LocalString.Contains(SubString))
Define Array
string[] ArrayName = new string[ArraySize];
Puedo Random Number
Random rnd = new Random();
int RandomNumber = rnd.Next(MinInteger, MaxInteger);
Convert string into integer
int PostInteger = int.Parse(PreString);
Parse string based upon delimiter
string[] SubString = PreString.Split('Delimiter');
Parse string into sub-strings
string SubString = PreString.Substring(StartLoc, Length);