Archive for the ‘WinForms’ Category

Calculating width of TextBox dynamically based on Text in C#

Tuesday, December 23rd, 2008

Sometimes we need to expand the TextBox dynamically based on the length of the entered text. TextBox does not have a AutoSize property by which it can adjust it’s size based on the content. On way of calculating the Width for the TextBox is using the Graphics.MeasureString and calculating the Pixel width. This method has it’s Pros and cons.

(more…)

.Net Blocking websites

Sunday, July 27th, 2008

Think in the lines of Parental control application where we need to block certain websites from being accessed. To make it harder, this will be a Windows application where user can configure the sites to be blocked and unblocked.

Let’s start thinking of what we can do to achieve this.
(more…)