-
Recent Posts
-
Recent Comments
Archives
- 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
Tag Archives: random
Use VBA code to pick random cells from a filtered selection in an Excel workbook
This example shows how you can use VBA code to pick random cells in an Excel workbook when the selected cells are filtered. The post Use VBA code to pick random cells from the currently selected cells in an Excel … Continue reading
Posted in Excel, VBA
Tagged C#, C# programming, example, example program, Excel, pick random cells, pick random elements, pick random items, random, VBA, Windows Forms programming
Leave a comment
Make a random tree of generic TreeNode objects in C#
The example Handle generic TreeNode mouse events in C# explains how to build a tree where each node is represent by a TreeNode object. Each TreeNode contains its own object that determines how the node is drawn. This example the … Continue reading
Posted in classes, generic, OOP
Tagged C#, C# programming, classes, example, example program, generic, generic classes, OOP, random, random tree, TreeNode, trees, Windows Forms programming
Leave a comment
Make a Shakespeare insult generator in C#
This example shows how to build a Shakespeare insult generator by selecting one word from each of three arrays and combining the results. The following code shows the arrays (with many values omitted to save space). // The insult pieces … Continue reading
Draw ransom note text in a RichTextBox in C#
This example is similar to the post Draw ransom note text in C# but it writes text into a RichTextBox instead of on a PictureBox. This has the following advantages. The code is simpler The RichTextBox can arrange text more … Continue reading
Posted in graphics, strings
Tagged C#, C# programming, example, example program, font, graphics, random, random color, random font, ransom note, ransom note text, strings, Windows Forms programming
Leave a comment
Draw ransom note text in C#
This example draws each of the characters in a string in a different random font to produce a ransom note text effect. The program starts by using the following code to create arrays holding font names and brushes from which … Continue reading
Posted in graphics, strings
Tagged C#, C# programming, example, example program, font, graphics, random, random color, random font, ransom note, ransom note text, strings, Windows Forms programming
1 Comment
Produce a repeatable series of “random” numbers in C#
The Random class can generate a series of pseudo-random numbers. They’re called “pseudo-random” rather than “random” because the numbers are generated by a mathematical algorithm rather than by some completely unpredictable process such as observing a source of radioactive decay … Continue reading
Make extension methods to generate random double values in C#
This example adds extension methods to the Random class to generate double values within a specified range. The Random class provides methods for generating pseudo-random numbers. The Next method has three overloaded versions that produce a non-negative integer, an integer … Continue reading
Make a hangman game in C#
Special thanks to Jeff Scarterfield for the skeleton drawing used by the program. This example builds a simple hangman game that uses the dictionary created by the example Use LINQ to select words of certain lengths from a file in … Continue reading
Posted in algorithms, files, games, graphics, strings
Tagged algorithms, C#, C# programming, example, example program, files, games, graphics, hangman, hangman game, random, strings, Windows Forms programming
Leave a comment
Fill a shape with random lines in C#
Click and drag to draw a shape. When you release the mouse, the program closes the shape and fills it with random line segments. The following code shows how the program lets you draw a shape. // The points selected … Continue reading