-
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: December 2016
Five hats puzzle solution
If you haven’t read it yet, read the Five hats puzzle. Recall that the warden has three white hats and two black hats. If the first prisoner, Art, saw two black hats, then he would know that he had a … Continue reading
Posted in books, games, puzzles
Tagged books, C#, C# programming, example, example program, five hats, five hats puzzle, games, hats puzzle, Interview Puzzles Dissected, puzzles, Windows Forms programming
Leave a comment
Five hats puzzle
This “hats puzzle” was described on December 26, 2016 on NPR’s Car Talk show. Sadly Tommy died in 2014 and the show was a rebroadcast so this puzzler has probably been used before. My book Interview Puzzles Dissected doesn’t include … Continue reading
Posted in books, games, puzzles
Tagged C#, C# programming, example, example program, five hats, five hats puzzle, games, hats puzzle, Interview Puzzles Dissected, puzzles, Windows Forms programming
Leave a comment
Convert a string to proper case (title case) in C#
In proper case (or title case) the first letter of each word is capitalized. This is actually pretty easy once you know where to find the method that converts to proper case. The example uses the following code to convert … Continue reading
Posted in strings
Tagged C#, C# programming, capitalization, example, example program, format, format string, proper case, string format, strings, title case, Windows Forms programming
2 Comments
Make TextBoxes automatically convert case in C#
It’s actually quite easy to make a TextBox convert case in .NET. Simply set the TextBox control’s CharacterCasing property to Lower or Upper. Then the control automatically converts alphabetic characters into the correct case. You can do this at design … Continue reading
Posted in controls, strings, user interface
Tagged C#, C# programming, case, CharacterCasing, controls, convert case, example, example program, lower case, strings, upper case, user interface, Windows Forms programming
Leave a comment
See if Internet Explorer uses a proxy in C#
This example determines whether the system has Internet Explorer configured to use a proxy. Internet Explorer lets you specify proxy settings. In the Tools menu, select Internet Options. On the Connections tab, click the LAN Settings button. The goal of … Continue reading
Posted in internet, network, system
Tagged C#, C# programming, example, example program, internet, Internet Explorer, network, proxy, proxy settings, system, Windows Forms programming
Leave a comment
Move a window with a title that matches a pattern in C#
The example Set another application’s size and position in C# uses the FindWindow API function to find a window with a given title. Unfortunately FindWindow only finds the window if the title is an exact match. If you only know … Continue reading
Tile desktop windows in rows and columns in C#
The example List desktop windows in C# shows how to list the currently running desktop windows. This example uses that technique to fill a ListBox with the titles of those desktop windows. (See the previous example to see how that … Continue reading
Set another application’s size and position in C#
When I write books, there is usually a maximum size that a screen shot can be. I wrote this program to make it easy to set an example program to exactly that size. This program uses the FindWindow API function … Continue reading
Posted in API, miscellany, system
Tagged API, C#, C# programming, example, example program, find window by caption, FindWindowByCaption, get window placement, GetWindowPlacement, maximize application, maximize other application, maximize window, minimize application, minimize other application, minimize window, miscellaneous, miscellany, restore application, restore other application, restore window, set window placement, set window state, SetWindowPlacement, system, target window, Windows Forms programming
5 Comments
Find a target window and minimize, maximize, or restore it in C#
This is the first in a series of posts that allow one application to manipulate a target window in another application. Note that this isn’t something that Microsoft really wants you to do. In general one application should not fiddle … Continue reading
Posted in API, miscellany, system
Tagged API, C#, C# programming, example, example program, find window by caption, FindWindowByCaption, get window placement, GetWindowPlacement, maximize application, maximize other application, maximize window, minimize application, minimize other application, minimize window, miscellaneous, miscellany, restore application, restore other application, restore window, set window placement, set window state, SetWindowPlacement, system, target window, Windows Forms programming
4 Comments
Make a stopwatch in C#
This program is a simple stopwatch. When you click the Start button, the program changes the button’s caption to Stop and starts a Timer. As the stopwatch Timer runs, the program displays the elapsed time. Click the Stop button to … Continue reading