Tag Archives: tabs

Use StringFormat to align text in columns in C#

My previous post Use tabs and StringFormat to align text in C# showed how to use a StringFormat object to draw tab-delimited text in columns. Unfortunately, that method doesn’t give you control over how the values in each column are … Continue reading

Posted in fonts, graphics, strings | Tagged , , , , , , , , , , , , , | 2 Comments

Use tabs and StringFormat to align text in C#

This example shows how you can use a StringFormat object to align tab-delimited text when drawing it on a window. The Graphics class’s DrawString method draws a string on a window, PictureBox, Bitmap, or other drawing surface. The DrawString method … Continue reading

Posted in fonts, graphics, strings | Tagged , , , , , , , , , , , , , | 1 Comment

Write a TreeView into a tab-delimited file in C#

The example Load a TreeView from a tab-delimited file in C# shows how to load a TreeView control from a file. This example shows how to do the converse: write a TreeView control’s values into a file. The following SaveTreeViewIntoFile … Continue reading

Posted in algorithms, controls, files, recursion | Tagged , , , , , , , , , , , | Leave a comment

Set RichTextBox tab stops in C#

You can set different RichTextBox tab stops for different parts of a RichTextBox control’s text. This example uses the following code to set tabs for the whole control and then adds some text to it that includes tabs. // Set … Continue reading

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

Set tab positions inside a ListBox or TextBox in C#

This example demonstrates three methods for aligning values in columns, two of which set tab positions in a ListBox or TextBox. To set tabs in a ListBox, you need to set the control’s UseCustomTabOffsets property to true. Then get the … Continue reading

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