Browse Source

Add constructor that takes a text argument

Ross Ferguson 5 years ago
parent
commit
6f97585427
1 changed files with 13 additions and 0 deletions
  1. 13 0
      Terminal.Gui/Views/ComboBox.cs

+ 13 - 0
Terminal.Gui/Views/ComboBox.cs

@@ -78,6 +78,19 @@ namespace Terminal.Gui {
 			Initialize ();
 		}
 
+		/// <summary>
+		/// Public constructor
+		/// </summary>
+		/// <param name="text"></param>
+		public ComboBox (ustring text) : base ()
+		{
+			search = new TextField ("");
+			listview = new ListView () { LayoutStyle = LayoutStyle.Computed, CanFocus = true };
+
+			Initialize ();
+			Text = text;
+		}
+
 		/// <summary>
 		/// Public constructor
 		/// </summary>