Category Archives: user interface

Disable the charms gesture in Windows 8 (and learn a bit about user interface design)

I still really like my new laptop (see my post Quick review of a new laptop), but one thing I really hate about Windows 8 is the way the charms bar kept popping up at seemingly random times. I would … Continue reading

Posted in miscellany, user interface | Tagged , , , , , , , , , , , | 2 Comments

Display database pictures in a ListView control in C#

This example shows how you can display database pictures in a ListView control. My previous post, Create ListView icons at run time in C#, explained how to make images at runtime to display in a ListView control. This example follows … Continue reading

Posted in controls, user interface | Tagged , , , , , , , , , , , , , , , , , , , | 10 Comments

Make a skinned form in C#, Part 2 (the code)

My previous post explained the controls that this example uses to let you give a form a skin. Basically an arrangement of Panel and PictureBox controls with the Dock properties set appropriately draw the form’s edge and corner images. If … Continue reading

Posted in user interface | Tagged , , , , , , , , | Leave a comment

Make a skinned form in C#, Part 1 (the controls)

A skinned form is just plain cool. It adds a bit of interest to the square windows used by every other application. By setting a Windows Form’s TransparencyKey property to a color that should not be rendered, you can make … Continue reading

Posted in user interface | Tagged , , , , , , , | 1 Comment

Make a PictureBox act like a button in C#

This program uses several images to make a PictureBox behave like a button. These images give you complete control over how the “button” looks as it is pressed and released. A button should have these behaviors: When the mouse is … Continue reading

Posted in controls, user interface | Tagged , , , , , , , , , | Leave a comment

Display a horizontal scrollbar in a ListBox in C#

Displaying a horizontal scrollbar is easy but useful. If you need to display some long values in a ListBox, you may want to be able to scroll to the right to see the ends of the values. For example, this … Continue reading

Posted in controls, user interface | Tagged , , , , , , , , , , , | Leave a comment

Resize a RichTextBox to fit its contents in C#

This example shows how you can resize a RichTextBox control so it fits the text and images that it contains. The example Resize a TextBox to fit its text in C# shows how to make a TextBox fit its text. … Continue reading

Posted in controls, user interface | Tagged , , , , , , , , , , , | 5 Comments

Make a scrolled window in C#

Making a scrolled window is really easy, at least if you’ve seen how to do it before. If you haven’t seen it, you can spend a lot of time building your own scrolled window out of PictureBox, VerticalScrollBar, and HorizontalScrollBar … Continue reading

Posted in miscellany, user interface | Tagged , , , , , , , , , | Leave a comment

Resize a TextBox to fit its text in C#

This example shows how you can resize a TextBox to fit its contents as the user types. The key is the following AutoSizeTextBox method. // Make the TextBox fit its contents. private void AutoSizeTextBox(TextBox txt) { const int x_margin = … Continue reading

Posted in controls, user interface | Tagged , , , , , , , , , , , | 1 Comment

Make an owner-drawn ListBox that justifies columns in C#

This example shows how you can use an owner-drawn ListBox to left and right align values in columns. The following examples show different ways to align values in columns. Draw aligned columns of data in C# Format values in a … Continue reading

Posted in controls, fonts, graphics, lists, user interface | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment