ListControlContainer.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:ListControlContainer.cs
  5. * 2.功能描述:容器控件
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2014/09/04 1.00 新建
  9. *******************************************************************************/
  10. using System.ComponentModel;
  11. using System.Drawing;
  12. using System.Windows.Forms;
  13. namespace Dongke.IBOSS.PRD.Basics.BaseControls
  14. {
  15. /// <summary>
  16. /// A container control for the ListControl to ensure the ScrollBar on the ListControl does not
  17. /// Paint over the Size grip. Setting the Padding or Margin on the Popup or host control does
  18. /// not work as I expected.
  19. /// </summary>
  20. [ToolboxItem(false)]
  21. public partial class ListControlContainer : UserControl
  22. {
  23. #region CONSTRUCTOR
  24. public ListControlContainer()
  25. : base()
  26. {
  27. BackColor = SystemColors.Window;
  28. BorderStyle = BorderStyle.FixedSingle;
  29. AutoScaleMode = AutoScaleMode.Inherit;
  30. ResizeRedraw = true;
  31. // If you don't set this, then resize operations cause an error in the base class.
  32. MinimumSize = new Size(1, 1);
  33. MaximumSize = new Size(500, 500);
  34. }
  35. #endregion
  36. #region RESIZE OVERRIDE REQUIRED BY THE POPUP CONTROL
  37. /// <summary>
  38. /// Prescribed by the Popup class to ensure Resize operations work correctly.
  39. /// </summary>
  40. /// <param name="m"></param>
  41. protected override void WndProc(ref Message m)
  42. {
  43. if ((Parent as Popup).ProcessResizing(ref m))
  44. {
  45. return;
  46. }
  47. base.WndProc(ref m);
  48. }
  49. #endregion
  50. }
  51. }