PageRenderTime 41ms CodeModel.GetById 13ms 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. Control Customization Sample
  4. ===============================================================================
  5. /////////////////////////////////////////////////////////////////////////////
  6. Use:
  7. The Control Customization sample demonstrates how to customize the Windows Forms
  8. controls.
  9. In this sample, there're 4 examples:
  10. 1. Multiple Column ComboBox.
  11. Demonstrates how to display multiple columns of data in the dropdown of a ComboBox.
  12. 2. ListBox Items With Different ToolTips.
  13. Demonstrates how to display different tooltips on each items of the ListBox.
  14. 3. Numeric-only TextBox.
  15. Demonstrates how to make a TextBox only accepts numbers.
  16. 4. A Round Button.
  17. Demonstrates how to create a Button with irregular shape.
  18. /////////////////////////////////////////////////////////////////////////////
  19. Code Logic:
  20. 1. Example 1: "Multiple Column ComboBox".
  21. 1). Create a DataTable with several columns and rows of data;
  22. 2). Data bind the ComboBox control to the DataTable;
  23. 3). Enable the owner draw on ComboBox by setting the DrawMode property to
  24. DrawMode.OwnerDrawFixed;
  25. 4). Handle the DrawItem event on the ComboBox;
  26. 5). In the DrawItem event handler, compute the bounds for each column and
  27. draw corresponding value for each column on its bounds.
  28. 2. Example 2: "ListBox Items With Different ToolTips".
  29. 1). Add some items to the ListBox control;
  30. 2). Handle the MouseMove event on the ListBox control;
  31. 3). Call the ListBox.IndexFromPoint method to retrieve the item index at
  32. where the mouse hovers;
  33. 4). If the mouse is over the items, call ToolTip.SetToolTip method to display
  34. a tooltip for the individual item.
  35. 3. Example 3: "Numeric-only TextBox".
  36. The make a TextBox accepts only numbers, we can handle the TextBox.KeyPress
  37. event, in the event handler use char.IsNumber method to filter the input keys.
  38. 4. Example 4: "A Round Button".
  39. The key point of creating a round button is changing its Region property.
  40. /////////////////////////////////////////////////////////////////////////////
  41. References:
  42. 1. Windows Forms General FAQ.
  43. http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/77a66f05-804e-4d58-8214-0c32d8f43191
  44. 2. Shaped Windows Forms and Controls in Visual Studio .NET
  45. http://msdn.microsoft.com/en-us/library/aa289517.aspx
  46. 3. Round Button in C#
  47. http://www.codeproject.com/KB/buttons/RoundButton_csharp.aspx
  48. /////////////////////////////////////////////////////////////////////////////