-
Recent Posts
-
Recent Comments
- RodStephens on Use a standard Windows dialog to let the user select folders in C#
- Yohann on Use a standard Windows dialog to let the user select folders in C#
- Fred on Draw and move polygons snapping them to a grid in C#
- RodStephens on Display the local time and GMT in C#
- RodStephens on Draw a 3D surface with WPF, XAML, and C#
Archives
- January 2021
- December 2020
- November 2020
- October 2020
- September 2020
- August 2020
- July 2020
- June 2020
- May 2020
- April 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- September 2019
- August 2019
- July 2019
- June 2019
- May 2019
- April 2019
- March 2019
- February 2019
- January 2019
- December 2018
- November 2018
- October 2018
- September 2018
- August 2018
- July 2018
- June 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- February 2014
- January 2014
- December 2013
- October 2013
- August 2013
- June 2013
- December 2012
- September 2012
- July 2012
- June 2012
- November 2011
- May 2011
- April 2011
- February 2011
- December 2010
Categories
- .NET
- 3D
- 3D graphics
- ADO.NET
- algorithms
- animation
- API
- arrays
- attributes
- audio
- books
- C#
- C# programming
- calculations
- challenges
- classes
- clipboard
- coding
- combinatorics
- console
- controls
- cryptography
- curve fitting
- database
- debugging
- dialogs
- directories
- Drag and Drop
- drawing
- drawings
- enums
- Event
- events
- example program
- Excel
- extension methods
- extensions
- files
- finance
- fonts
- formatting
- forms
- fractals
- ftp
- games
- GDI+
- generic
- geometry
- globalization
- graphics
- html
- IDE
- image processing
- inheritance
- interfaces
- internationalization
- internet
- interoperability
- LINQ
- lists
- localization
- mathematics
- memory
- menus
- MessageBox
- methods
- miscellany
- multimedia
- network
- Office
- OOP
- operators
- parsing
- performance
- phone
- PowerPoint
- printers
- printing
- productivity
- programs
- puzzles
- recursion
- reflection
- registry
- regular expressions
- serialization
- settings
- SQL
- stories
- strings
- syntax
- system
- threading
- three-dimensional graphics
- tips
- tools
- transformations
- Uncategorized
- user interface
- variables
- VBA
- web
- Windows Forms programming
- WMI
- Word
- wpf
- XAML
- XML
Meta
Monthly Archives: September 2014
Use nullable parameters in C#
This example shows how you can use nullable parameters to simulate optional parameters. The example Use null to simulate optional parameters in C# explains how you can pass null to a method to simulate optional parameters, but that only works … Continue reading
Posted in OOP, syntax
Tagged C#, C# programming, example, example program, null, OOP, optional parameters, overloaded methods, simulate optional parameters, syntax, Windows Forms programming
2 Comments
Use null to simulate optional parameters in C#
This example shows how you can use null to simulate optional parameters in older versions of C#. The example Use overloaded methods to simulate optional parameters in C# shows how you can use overloaded methods to simulate optional parameters. Another … Continue reading
Posted in OOP, syntax
Tagged C#, C# programming, example, example program, null, OOP, optional parameters, overloaded methods, simulate optional parameters, syntax, Windows Forms programming
1 Comment
Use overloaded methods to simulate optional parameters in C#
This example shows how you can simulate optional parameters if you’re using an older version of C#. Named and optional parameters were introduced in C# 2010. If you’re using an older version, you should probably upgrade if you can. But … Continue reading
Posted in OOP, syntax
Tagged C#, C# programming, example, example program, OOP, optional parameters, overloaded methods, simulate optional parameters, syntax, Windows Forms programming
1 Comment
Calculate and highlight DataGridView values in C#
This example shows how to calculate and highlight DataGridView values at run time. It uses the following code to initialize its DataGridView control. It sets each item’s description, unit price, and quantity, but not its total cost. // Make some … Continue reading
Initialize DataGridView controls with objects in C#
This example shows how to easily initialize DataGridView controls to display the properties of items. This example uses the following OrderItem class. Notice that the constructor calculates the TotalCost from the Quantity and UnitPrice. public class OrderItem { public string … Continue reading
Posted in controls, user interface
Tagged C#, C# programming, controls, DataGridView, example, example program, user interface, Windows Forms programming
Leave a comment
Draw a colored fractal curve generated by prime numbers in C#
This example shows how to draw a colored fractal curve generated by prime numbers. See the example Draw a fractal curve generated by prime numbers in C# for the basic algorithm. This example assigns colors to line segments based on … Continue reading
Posted in algorithms, fractals, graphics, mathematics
Tagged algorithms, C#, C# programming, color, colored fractal, example, example program, fractal curve, fractals, graphics, mathematics, prime numbers, primes, Windows Forms programming
Leave a comment
Draw a fractal curve generated by prime numbers in C#
This example shows how to draw a fractal curve generated by prime numbers. It’s a modification of the earlier example Draw a fractal generated by prime numbers in C#. The basic idea is follow these rules: Start at the point … Continue reading
Posted in algorithms, fractals, graphics, mathematics
Tagged algorithms, C#, C# programming, example, example program, fractal curve, fractals, graphics, mathematics, prime numbers, primes, Windows Forms programming
1 Comment
Set DataGridView column styles in C#
You can set DataGridView column styles by setting a column’s DefaultCellStyle property. It determines the column’s appearance including its foreground color, background color, font, alignment, and colors to use when an item is selected. To set a column’s style at … Continue reading
Use the predefined system colors in C#
The static System.Drawing.SystemColors class defines properties that give the system colors. These include colors for such items as active objects, highlighted text, captions, and window frames. This example uses the following code to list the defined system colors. // List … Continue reading
Posted in drawing, graphics, reflection
Tagged C#, C# programming, colors, drawing, example, example program, graphics, HotTrack, reflection, system, Windows Forms programming
Leave a comment
Encrypt or decrypt files in C#
The following EncryptFile and DecryptFile methods encrypt or decrypt files at a very high level. // Encrypt or decrypt a file, saving the results in another file. public static void EncryptFile(string password, string in_file, string out_file) { CryptFile(password, in_file, out_file, … Continue reading
Posted in cryptography, files
Tagged C#, C# programming, decrypt, decrypt files, decryption, encrypt, encrypt files, encryption, example, example program, files, Windows Forms programming
7 Comments