PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/CSWinFormControls/ReadMe.txt

#
Plain Text | 71 lines | 48 code | 23 blank | 0 comment | 0 complexity | 499859588773f9268a2fd572323f6cc8 MD5 | raw file
 1================================================================================
 2       WINDOWS FORMS APPLICATION : CSWinFormControls Project Overview
 3       
 4                        Control Customization Sample
 5                        
 6===============================================================================
 7
 8/////////////////////////////////////////////////////////////////////////////
 9Use:
10
11The Control Customization sample demonstrates how to customize the Windows Forms 
12controls.
13
14In this sample, there're 4 examples:
15 
161. Multiple Column ComboBox.
17   Demonstrates how to display multiple columns of data in the dropdown of a ComboBox.
182. ListBox Items With Different ToolTips.
19   Demonstrates how to display different tooltips on each items of the ListBox.
203. Numeric-only TextBox.
21   Demonstrates how to make a TextBox only accepts numbers.
224. A Round Button.
23   Demonstrates how to create a Button with irregular shape.
24   
25
26/////////////////////////////////////////////////////////////////////////////
27Code Logic:
28
291. Example 1: "Multiple Column ComboBox".
30
31   1). Create a DataTable with several columns and rows of data;
32   2). Data bind the ComboBox control to the DataTable;
33   3). Enable the owner draw on ComboBox by setting the DrawMode property to 
34       DrawMode.OwnerDrawFixed;
35   4). Handle the DrawItem event on the ComboBox;
36   5). In the DrawItem event handler, compute the bounds for each column and 
37       draw corresponding value for each column on its bounds.
38
392. Example 2: "ListBox Items With Different ToolTips".
40
41   1). Add some items to the ListBox control;
42   2). Handle the MouseMove event on the ListBox control;
43   3). Call the ListBox.IndexFromPoint method to retrieve the item index at 
44       where the mouse hovers;
45   4). If the mouse is over the items, call ToolTip.SetToolTip method to display
46       a tooltip for the individual item.
47   
483. Example 3: "Numeric-only TextBox".
49
50   The make a TextBox accepts only numbers, we can handle the TextBox.KeyPress 
51   event, in the event handler use char.IsNumber method to filter the input keys.
52   
534. Example 4: "A Round Button".
54
55   The key point of creating a round button is changing its Region property.
56   
57
58/////////////////////////////////////////////////////////////////////////////
59References:
60
611. Windows Forms General FAQ.
62   http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/77a66f05-804e-4d58-8214-0c32d8f43191
63
642. Shaped Windows Forms and Controls in Visual Studio .NET
65   http://msdn.microsoft.com/en-us/library/aa289517.aspx
66
673. Round Button in C#
68   http://www.codeproject.com/KB/buttons/RoundButton_csharp.aspx
69
70
71/////////////////////////////////////////////////////////////////////////////