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

编辑器/阅读器

开发平台:

C#

  1. // -- FILE ------------------------------------------------------------------
  2. // name       : ComboBox.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;
  13. using System.Web.UI.WebControls;
  14. namespace Itenso.WebUserForms.Controls
  15. {
  16. #if TP_COMBO_FIELDS
  17. // ------------------------------------------------------------------------
  18. [DefaultProperty( "FieldName" )]
  19. [Designer( typeof( UserFormFieldDesigner ) )]
  20. [ToolboxBitmap( typeof( ResFinder ), "Itenso.WebUserForms.Controls.Images.ComboBox.png" )]
  21. public class ComboBox : System.Web.UI.WebControls.DropDownList, IListField, IPlaceholderControl
  22. {
  23. // ----------------------------------------------------------------------
  24. [DefaultValue( "" )]
  25. [Description( "ComboBox Form Field Name" )]
  26. [Category( "Web User Forms" )]
  27. public string FieldName
  28. {
  29. get { return this.fieldName; }
  30. set { this.fieldName = value; }
  31. } // FieldName
  32. // ----------------------------------------------------------------------
  33. [DefaultValue( "" )]
  34. [Description( "ComboBox Form Field Value" )]
  35. [Category( "Web User Forms" )]
  36. public string FieldValue
  37. {
  38. get { return ListControlTool.GetSelectionValue( this ); }
  39. set
  40. {
  41. ListControlTool.ResetItemSelection( this );
  42. ListControlTool.SetSelectionValue( this, value );
  43. }
  44. } // FieldValue
  45. // ----------------------------------------------------------------------
  46. [DefaultValue( "" )]
  47. [Description( "ComboBox Form Field Custom Text" )]
  48. [Category( "Web User Forms" )]
  49. public bool AllowCustomText 
  50. {
  51. get { return this.allowCustomText; }
  52. set { this.allowCustomText = value; }
  53. } // AllowCustomText 
  54. // ----------------------------------------------------------------------
  55. [DefaultValue( "" )]
  56. [Description( "ComboBox Form Field Auto Complete" )]
  57. [Category( "Web User Forms" )]
  58. public bool AutoComplete
  59. {
  60. get { return this.autoComplete; }
  61. set { this.autoComplete = value; }
  62. } // AutoComplete 
  63. // ----------------------------------------------------------------------
  64. [Browsable( false )]
  65. bool IUserFormField.AllowEdit
  66. {
  67. get { return Enabled; }
  68. set { Enabled = value; }
  69. } // AllowEdit
  70. // ----------------------------------------------------------------------
  71. [Browsable( false )]
  72. Control IPlaceholderControl.Control
  73. {
  74. get { return this; }
  75. } // IPlaceholderControl.Control
  76. // ----------------------------------------------------------------------
  77. public override string ToString()
  78. {
  79. return FormFieldTool.GetFieldDescription( this );
  80. } // ToString
  81. // ----------------------------------------------------------------------
  82. // members
  83. private string fieldName;
  84. private bool allowCustomText;
  85. private bool autoComplete;
  86. } // class ComboBox
  87. #endif // TP_COMBO_FIELDS
  88. } // namespace Itenso.WebUserForms.Controls
  89. // -- EOF -------------------------------------------------------------------