using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SelectListItemByText
{
    public partial class frm54SelectListItemByText : Form
    {
        public frm54SelectListItemByText()
        {
            InitializeComponent();
        }

        // Initialize the ComboBox and ListBox.
        private void frm54SelectListItemByText_Load(object sender, EventArgs e)
        {
            // list the time zones.
            timeZonesComboBox.DataSource = TimeZoneInfo.GetSystemTimeZones();
            timeZonesListBox.DataSource = TimeZoneInfo.GetSystemTimeZones();

            // Select Mountain Time.
            timeZonesComboBox.SelectedItem =
                timeZonesComboBox.FindItemContaining("Mountain Time");
            timeZonesListBox.SelectedItem =
                timeZonesListBox.FindItemContaining("Mountain Time");
        }


        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.timeZonesComboBox = new System.Windows.Forms.ComboBox();
            this.timeZonesListBox = new System.Windows.Forms.ListBox();
            this.SuspendLayout();
            // 
            // timeZonesComboBox
            // 
            this.timeZonesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
            | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.timeZonesComboBox.FormattingEnabled = true;
            this.timeZonesComboBox.Location = new System.Drawing.Point(12, 12);
            this.timeZonesComboBox.Name = "timeZonesComboBox";
            this.timeZonesComboBox.Size = new System.Drawing.Size(310, 21);
            this.timeZonesComboBox.TabIndex = 3;
            // 
            // timeZonesListBox
            // 
            this.timeZonesListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
            | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.timeZonesListBox.FormattingEnabled = true;
            this.timeZonesListBox.IntegralHeight = false;
            this.timeZonesListBox.Location = new System.Drawing.Point(12, 39);
            this.timeZonesListBox.Name = "timeZonesListBox";
            this.timeZonesListBox.Size = new System.Drawing.Size(309, 110);
            this.timeZonesListBox.TabIndex = 2;
            // 
            // frm54SelectListItemByText
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(334, 161);
            this.Controls.Add(this.timeZonesComboBox);
            this.Controls.Add(this.timeZonesListBox);
            this.Name = "frm54SelectListItemByText";
            this.Text = "SelectListItemByText";
            this.Load += new System.EventHandler(this.frm54SelectListItemByText_Load);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.ComboBox timeZonesComboBox;
        private System.Windows.Forms.ListBox timeZonesListBox;
    }
}