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

Copy Chart

Copy Chart To Clipboard MemoryStream MemoryStream1 = new MemoryStream(); Chart1.SaveImage(MemoryStream1, System.Windows.Forms.DataVisualization.Charting.ChartImageFormat.Bmp); System.Drawing.Bitmap Bitmap1 = new System.Drawing.Bitmap(MemoryStream1); System.Windows.Forms.Clipboard.SetImage(Bitmap1); Save Chart To File const string MY_FILE_EXTENSION = "png"; String SaveAsFilename; //If last directory is not valid then default to My Documents if (!Directory.Exists(Path.GetDirectoryName(ApMain.LastFileDirectory))) ApMain.LastFileDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); SaveFileDialog SelectFileDialog = new SaveFileDialog(); SelectFileDialog.Filter = "Image File (*." + […]

Read More

Creating A Chart With 2 Y Axis

  //——————————– //—– DO CHART BASIC SETUP —– //——————————– System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = (new System.Windows.Forms.DataVisualization.Charting.ChartArea()); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = (new System.Windows.Forms.DataVisualization.Charting.Legend()); chartArea1.AxisX.TitleFont = new System.Drawing.Font("Arial", 9); chartArea1.AxisY.TitleFont = new System.Drawing.Font("Arial", 9); chartArea1.AxisY2.TitleFont = new System.Drawing.Font("Arial", 9); //—– SETUP X AXIS (TIME) —– chartArea1.AxisX.Title = "Secs"; chartArea1.AxisX.Minimum = 0; chartArea1.AxisX.Maximum = (ApMain.GRAPHS_BUFFER_LOG_EVERY_SECS * ApMain.GRAPHS_BUFFER_LENGTH); chartArea1.AxisX.Interval = 60; //Axis […]

Read More

.Chart Control General

Good Tutorial https://msdn.microsoft.com/en-us/library/dd489237.aspx?f=255&MSPPError=-2147217396 Add a chart to a form Toolbox. > Data category > drag a Chart control onto the form If you can't see the Chart control right click in the Toolbox, select Choose Items, and then select the following namespaces in the .NET Framekwork Components tab: System.Web.UI.DataVisualization.Charting System.Windows.Forms.DataVisualization.Charting  

Read More

Using Strings-Values

Verifying numeric values See here. ToString() https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings Display Values With Decimal Places Fixed number of decimal places Optional number of decimal places When formatting numbers you can use “0” as mandatory place and “#” as optional place. Display Decimal Value Insert leading zero’s if necessary Display Decimal Places Display Hex Value Display Binary Value Display […]

Read More

File System

Move file Move-Item C:\MyDirectory1\MyFile.txt C:\MyDirectory2\ -force -force causes an overwrite if necessary. You can provide a full target path to perform a rename at the same time if wanted.

Read More

Connecting Via PowerShell

Some functions require you to connect via PowerShell, the following is based on the Micrsoft guide here: https://developer.microsoft.com/en-us/windows/iot/docs/powershell Setup for PowerShell Connection On your desktop PC search for "Windows PowerShell" > rigth click it and select Run As Administrator. You should now see the PowerShell console. Start the WinRM service on your desktop to enable remote […]

Read More

FTP Access

Enabling FTP Access FTP access is disabled by default Enable FTP on the device using the following powershell command: start C:\Windows\System32\ftpd.exe In file explorer on your PC in the address bar yhou can now connect to it using FTP by entering: ftp://<your_iot_device_name_or_IP>   To disable ftp again use the following: kill -processname ftpd* Resources https://developer.microsoft.com/en-us/windows/iot/docs/ftp

Read More