Setting up for programming

Ensure you have installed the latest Windows 10 SDK Download the latest Windows 10 SDK https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

Read More

Converting Variables

Convert Float / Single to Bytes float float1 = 1.0F; Byte[] ByteArray1 = BitConverter.GetBytes(float1); Convert Bytes to Float/Single Byte[] ByteArray1 = new Byte[4] {1,2,3,4}; float float1 = BitConverter.ToSingle(ByteArray1, 0);    

Read More

Making Visual C# work the way we like

Menu > Tools > Options Text Editor > C# General > Automatic brace completion = Off Tabs > Keep tabs Code Style > Formatting > Indentation > General > Automatically format on paste (disables really annoying effects of auto formatting on blocks below what you paste in) Code Style > Formatting > Indentation > Indent […]

Read More

Verify Numeric Value

  int Value = 0; bool ValueIsNumeric = int.TryParse(MyStringValue, out Value); For larger values: UInt64 i = 0; ValueIsNumeric = UInt64.TryParse(MyStringValue, out Value); Verifying a form TextBox value example //***************************************************** //***************************************************** //*********** VERIFY NUMBERIC TEXT BOX VALUE ********** //***************************************************** //***************************************************** private void VerifyTextBoxNumericValue(ref TextBox TextBox1, int MinValue, int MaxValue, int DefaultValue) { try { int […]

Read More

Rename project

Open the project and rename in the solution explorer Change output exe name Right click on project in Solution Explorer and select "Properties" from popup menu > "Application" change the "Assembly name"    

Read More

Using Radio Buttons

Grouping Radio buttons must be grouped on a form, for instance inside a group box or Panel Usage MyRadioButton.Checked = true; MyRadioButton.Checked = false; if(!MyRadioButton.Checked) //If not checked    

Read More

Change target .net framework version

Right click project in Solution Explorer window and choosing Unload Project. Right click project > Edit projectname.vcxproj Edit <TargetFrameworkVersion> to be the version you want to target Right click project > Reload project  

Read More