Posts

Showing posts with the label CodeProject

Implementation of Downsampling Algorithm in MSChart Extension

Image
Introduction Throughout the years of development is MSChart Extension, performance issue on displaying large data size was still remain unsolved. When refreshing a chart on application, we want it to draw as fast as possible to minimize user waiting time and minimize memory consumption. When working with Microsoft Chart Control (MSChart) in WinForms, the amount of memory used and time to draw a chart gets longer with increased of data size. FastLine series have better performance but still suffer from performance hit when data size growth beyond 100K data points. Moreover, plotting large data points on screen with limited pixels caused all the data points and lines overlapped, resulting misinterpretation of information to user. Example below shows sinewave with constant frequency of 100K data points compare to downsampled chart with 500 data points. Sinewave with 100K data points Sinewave downsampled to 500 data points About Largest-Triangle-Three-Bucket (LTTB) Algorithm It's clear...

What's new in Microsoft Chart Control (MSChart) Extension Version 3

Image
Introduction MSChart Extension is an extension class for Microsoft Chart (MSChart) control in Visual Studio for WinForms applications. The tool was first published on July 2012 with the intention to overcome some of the limitation from the original MSChart and provide new functions. With zoom, pan and cursors added, the stock MSChart components can be use as an oscilloscope for waveform display and inspection. The source code and compiled package is available for download at: Download from GitHub Download from NuGet Articles regarding the previous release is available here: MSChartExtension Articles In this article, we will explore what are the new features included in Version 3, let's have a look. We tried to maintain backward compatibility with previous release to minimize changes required to your project, some of the methods and implementation had to be change for better implementation. New Features Chart Cursor Label Formatted String (Prefix, Post...

Command Line Helper

Image
Description CommandLineHelper is a utility class in WinForms Controls created to parse command line arguments for Windows Forms application easily. The purpose of command line for WinForms application is used to launch application with user selected configuration. To make it more user friendly, a built in Command Line Builder Dialog is available to help user to create command line using the available options, create batch file as well as create window's shortcut. Arguments and Switches Command line parameters are categorized as arguments and switches where argument are mandatory parameter while switches on the other hand are optional parameter. Arguments and switches are registered to application by developer using AddArgument and AddSwitch functions. Switches normally use as an true or false logic. An optional variable can be added to define quantitative value, for example: /T:time Usage Initialization Create a new instance CommandLineHelper cmdLine = new ...

.NET Diagnostic Output for WinForms

Image
Debug and Trace output are two useful components in System.Diagnostic to immediate report on application status and information during run-time in WinForms application. DiagnosticsTextBox is a WinForms control derived from TextBox created to display Debug and Trace output which works with multi-threaded applications. The framework of DiagnosticsTextBox is described in this post: Diagnostics TextBox Download from GitHub: CodeArtEng.Diagnostics Download from NuGet Package EASY TO USE No manual configuration required, just drag and drop the DiagnosticsTextBox from CodeArtEng.Diagnostics.dll to your WinForm application, it will start capture traces once your application is start. What's New File writer split from DiagnosticsTextBox as standalone class, named as TraceFileWriter . Introduced buffer control in DiagnosticsTextBox to limit memory consumption. TraceFileWriter TraceFileWriter is created as stand-alone file writer which output traces to selected file...

MSChart Extension V2

Image
Introduction MSChart Extension is an extension class for Microsoft Chart (MSChart) control in Visual Studio for WinForms applications. The tool was first published on July 2012 (See: MSChart Extension - Zoom and Pan Control ) with the intention to overcome some of the limitation from the original MSChart. If you are new to MSChart Extension, we recommend you to read the previous article first. Version 2 is created based on Version 1 code base with new features and improvement introduced. The source code is also hosted on GitHub with the compiled package is released as NuGet Package . Download from GitHub Download from NuGet WARNING: The Version 2 released is not 100% backward compatible with Version 1, details as below.

Process Executor

Image
Description ProcessExecutor is a wrapper class for System.Diagnostic.Process which created with intention to manage external process within .NET application without showing up the console window and capture all the console output logs at the same time. Download From... GitHub NuGet CodeProject

OpenFilePanel and FolderBrowsePanel

Image
Description OpenFilePanel, FolderBrowsePanel   OpenFilePanel and FolderBrowsePanel are 2 new controls added to WinForms Controls Library released in Version 1.4.0 onward. This control is a combination of file / folder select dialog and textbox which allow user to select file / folder by either one of the following method: Select file / folder from open file dialog / folder browse dialog. Enter file / folder path into text box. Drag and drop file / folder from Window Explorer. Motivation These controls is created to simplify GUI design in Windows Forms application where file / folder select is widely use in each project. With this control, it eliminates the need to rewrite / copy the same piece of code again and again. Moreover, all projects that utilize this controls will get instant upgrade in future with new released assemblies without recompilation. Usage In general, both of ...

Microsoft Excel - Save As CSV (Macro)

This is a macro which will help you to save a worksheet to CSV (Comma-Separated Values) using a shortcut key. The trick is to execute a customized macro named "SaveAsCSV". You may further modify this macro to work for other format. Discussion below will be focused on using CSV format. How does it work? Save active excel file. Get file name for active excel file. Get current sheet name. Check if sheet name contains desired extension (.csv) Append file extension if required. Save current sheet as desired format (CSV). Close current CSV File. Reload active excel file.

Dynamic Load Assembly

Image
Introduction    Dynamic library loading is nothing new in native C++. In Microsoft Window’s implementation, this capability is realized with the use of Dynamic Link Library (DLL) . This feature greatly expands the flexibility of an application where new features can be added / modified in the form of plug-in without the need to recompile the entire application. Similar capability is provided in .NET framework to dynamically load assemblies which make plug-in development for .NET based application possible. Moreover, dynamic assembly loading that .NET framework provides is much more powerful than native C++ DLL. Wikipedia : plug-in is a software component that adds a specific feature to an existing software application.  Download Demo Download Sample Project

Most Recent Used List for WinForms (ToolStripMruList)

Image
ToolStripMruList allow you to add Most Recent Used (MRU) list to your .NET Windows Forms Application in ToolStrip and MenuStrip. This control is included in WinForms Controls Library . Features Integrated with ToolStripMenu. Customize number of files to remember.  Auto truncate long file name to defined length.  User define storage location for recent file list. Clear Recent File List. Remove Invalid Files.

WinForms Gauge Control

Image
Introduction WinForm Gauge - Released 2021   WinForm Gauge is successor for AGauge control, redesigned with better structure, performance and features. Find out more  at https://winformgauge.codearteng.com/     Original AGauge control AGauge is a gauge control for WinForms create by A.J.Bauer using GDI+. Original code was published in " Code Project - A fast and performing gauge " The version that I published here is an improved version of AGauge which contains the following changes. Download from GitHub   NOTE: We no longer actively maintaining AGauge. The development of this package is taken over by nutdotnet . Refer to his GitHub and NuGet page for details.   Improvements   Dynamic Gauge Label and Gauge Range Properties for gauge label (previously known as CapText ) and range are grouped into GaugeRanges and GaugeLabels which allow us to create any number of range and label ...

DDEApp, DDE Based Inter-process Communication (C#, C++)

Image
This article discuss an inter-process communication protocol dedicated for sharing data and perform remote function call between applications. Introduction   DDE Application (DDEApp) is a Dynamic Data Exchange (DDE) based inter-process communication protocol created to exchange data and perform functions call between applications. Back in 2009, when I was still programming in Borland C++ Builder, I needed to find a solution to call function remotely between two applications. We had decided to make use of DDE for this purpose. Using VCL control in Borland, we managed to get DDE up within few days. However, soon we realized that existing DDE protocol was not able to fully meet our requirement. About DDEApp   DDEApp a command line inter-process communication protocol implemented based on DDE. It contains a client and host class named as below. C# Borl...

DDEApp Tutorial (C#, C++)

Image
DDEApp LIBRARY USER GUIDE Supported OS Windows 32-bit Supported Platform Borland C++ Builder 6 V1.3.12 Borland Developer Studio 2006 V1.3.12 Microsoft.NET (Framework 2.0) V2.0.0 Introduction DDEApp is an application communication framework based on DDE communication protocol in order to exchange information between applications. This library was first designed to simplify and standardize DDE implementation for applications built on Borland C++ platforms. We have further extended the library to .NET framework to provide bridge between .NET applications and C++ applications.

MSChart Extension - Zoom and Pan Controls

Image
NEW : MSChart Extension 2.0 Released - Find out more Introduction - About MSChart Extension MSChart Extension is an extension package created to provide additional features and functions to Microsoft Chart (MSChart) control. This control is released under MIT license. Get latest source code and package from NuGet or GitHub. GitHub: https://github.com/Code-Artist/MSChartExtension NuGet:  http://nuget.org/packages/MSChartExtension

Step-by-step Setup TortoiseHg for gitHub

Image
This is a step-by-step instruction to setup TortoiseHg (A GUI shell extension  for Mercurial SCM) to use with github (Online project hosting using git Version Control System). Introduction There are few articles around the web with the same topics.  http://jamesmckay.net/2010/06/tortoisehg-as-a-github-client-on-windows/ https://gist.github.com/1568668 I was able to setup my TortoiseHg to work with github using the instruction written by James McKay. The document is very informative, but some of the steps are not written in details. Thus, I decided to write this documents to include some steps with additional screen shots.