ListBox.cs
上传用户:husern
上传日期:2022-03-24
资源大小:534k
文件大小:2k
源码类别:

编辑器/阅读器

开发平台:

C#

  1. // -- FILE ------------------------------------------------------------------
  2. // name       : ListBox.cs
  3. // project    : Itenso Web User Forms
  4. // created    : Jani Giannoudis - 2008.10.30
  5. // language   : c#
  6. // environment: .NET 2.0
  7. // copyright  : (c) 2008 by Itenso GmbH, Switzerland
  8. // --------------------------------------------------------------------------
  9. using System;
  10. using System.Drawing;
  11. using System.ComponentModel;
  12. using System.Web.UI.WebControls;
  13. namespace Itenso.WebUserForms.Controls
  14. {
  15. // ------------------------------------------------------------------------
  16. [DefaultProperty( "FieldName" )]
  17. [Designer( typeof( UserFormFieldDesigner ) )]
  18. [ToolboxBitmap( typeof( ResFinder ), "Itenso.WebUserForms.Controls.Images.ListBox.png" )]
  19. public class ListBox : System.Web.UI.WebControls.ListBox, IListField
  20. {
  21. // ----------------------------------------------------------------------
  22. [DefaultValue( "" )]
  23. [Description( "ListBox Form Field Name" )]
  24. [Category( "Web User Forms" )]
  25. public string FieldName
  26. {
  27. get { return this.fieldName; }
  28. set { this.fieldName = value; }
  29. } // FieldName
  30. // ----------------------------------------------------------------------
  31. [DefaultValue( "" )]
  32. [Description( "ListBox Form Field Value" )]
  33. [Category( "Web User Forms" )]
  34. public string FieldValue
  35. {
  36. get { return ListControlTool.GetSelectionValue( this ); }
  37. set
  38. {
  39. ListControlTool.ResetItemSelection( this );
  40. ListControlTool.SetSelectionValue( this, value );
  41. }
  42. } // FieldValue
  43. // ----------------------------------------------------------------------
  44. [Browsable( false )]
  45. bool IUserFormField.AllowEdit
  46. {
  47. get { return Enabled; }
  48. set { Enabled = value; }
  49. } // AllowEdit
  50. // ----------------------------------------------------------------------
  51. public override string ToString()
  52. {
  53. return FormFieldTool.GetFieldDescription( this );
  54. } // ToString
  55. // ----------------------------------------------------------------------
  56. // members
  57. private string fieldName;
  58. } // class ListBox
  59. } // namespace Itenso.WebUserForms.Controls
  60. // -- EOF -------------------------------------------------------------------