當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.AutoCompleteStringCollection類代碼示例

本文整理匯總了C#中System.Windows.Forms.AutoCompleteStringCollection的典型用法代碼示例。如果您正苦於以下問題:C# AutoCompleteStringCollection類的具體用法?C# AutoCompleteStringCollection怎麽用?C# AutoCompleteStringCollection使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AutoCompleteStringCollection類屬於System.Windows.Forms命名空間,在下文中一共展示了AutoCompleteStringCollection類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: autoComplete

 public AutoCompleteStringCollection autoComplete()
 {
     AutoCompleteStringCollection collection = new AutoCompleteStringCollection();
     try
     {
         SqlConnectionObj.Open();
         string query = "select * from tbl_room";
         SqlCommandObj.CommandText = query;
         SqlDataReader reader = SqlCommandObj.ExecuteReader();
         while (reader.Read())
         {
             string roomNo = reader["roomNo"].ToString();
             collection.Add(roomNo);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
         if (SqlConnectionObj != null && SqlConnectionObj.State == ConnectionState.Open)
         {
             SqlConnectionObj.Close();
         }
     }
     return collection;
 }
開發者ID:asm-morshed,項目名稱:Hall-Management-System,代碼行數:28,代碼來源:StudentGateway.cs

示例2: EDDiscoveryForm

        public EDDiscoveryForm()
        {
            InitializeComponent();

            EDDConfig = new EDDConfig();

            //_fileTgcSystems = Path.Combine(Tools.GetAppDataDirectory(), "tgcsystems.json");
            _fileEDSMDistances = Path.Combine(Tools.GetAppDataDirectory(), "EDSMDistances.json");

            string logpath="";
            try
            {
                logpath = Path.Combine(Tools.GetAppDataDirectory(), "Log");
                if (!Directory.Exists(logpath))
                {
                    Directory.CreateDirectory(logpath);
                }

            }
            catch (Exception ex)
            {
                Trace.WriteLine($"Unable to create the folder '{logpath}'");
                Trace.WriteLine($"Exception: {ex.Message}");
            }
            _edsmSync = new EDSMSync(this);

            trilaterationControl.InitControl(this);
            travelHistoryControl1.InitControl(this);
            imageHandler1.InitControl(this);

            SystemNames = new AutoCompleteStringCollection();
            Map = new EDDiscovery2._3DMap.MapManager();
        }
開發者ID:Udomyr,項目名稱:EDDiscovery,代碼行數:33,代碼來源:EDDiscoveryForm.cs

示例3: Reload

        /// <summary>Reloads the repo's objects tree.</summary>
        public void Reload()
        {
            // todo: task exception handling
            Cancel();
            _cancelledTokenSource = new CancellationTokenSource();
            var token = _cancelledTokenSource.Token;
            var tasks = rootNodes.Select(r => r.ReloadTask(token)).ToArray();
            Task.Factory.ContinueWhenAll(tasks,
                (t) =>
                {
                    if (!t.All(r => r.Status == TaskStatus.RanToCompletion))
                    {
                        return;
                    }
                    if (token.IsCancellationRequested)
                    {
                        return;
                    }
                    BeginInvoke(new Action(() =>
                    {
                        var autoCompletionSrc = new AutoCompleteStringCollection();
                        autoCompletionSrc.AddRange(
                            _branchFilterAutoCompletionSrc.ToArray());

                        txtBranchFilter.AutoCompleteCustomSource = autoCompletionSrc;
                    }));
                }, _cancelledTokenSource.Token);
            tasks.ToList().ForEach(t => t.Start());
        }
開發者ID:Yasami,項目名稱:gitextensions,代碼行數:30,代碼來源:RepoObjectsTree.cs

示例4: initGui

        public void initGui()
        {
            clg = new dataHandler.catalog(timeout: gpExtension.timeout);
            keyWords = new AutoCompleteStringCollection();
            keyWords.AddRange(  clg.getKeyWords().ToArray() );
            keywordTxt.AutoCompleteSource = AutoCompleteSource.CustomSource;
            keywordTxt.AutoCompleteCustomSource = keyWords;
            gdiThemes = clg.getGDIthemes();
            gdiThemes.Insert(0, "");
            GDIthemeCbx.DataSource = gdiThemes;

            orgNames = clg.getOrganisations();
            orgNames.Insert(0, "");
            orgNameCbx.DataSource = orgNames;

            dataBronnen = clg.getSources();
            List<string> bronnen = dataBronnen.Select(c => c.Key).ToList();
            bronnen.Insert(0, "");
            bronCatCbx.DataSource = bronnen;

            dataTypes = clg.dataTypes;
            List<string> dtypes = dataTypes.Select(c => c.Key).ToList();
            dtypes.Insert(0, "");
            typeCbx.DataSource = dtypes;

            inspKeyw = clg.inspireKeywords();
            inspKeyw.Insert(0, "");
            INSPIREthemeCbx.DataSource = inspKeyw;

            INSPIREannexCbx.DataSource = clg.inpireAnnex;

            INSPIREserviceCbx.DataSource = clg.inspireServiceTypes;

            filterResultsCbx.SelectedIndex = 0;
        }
開發者ID:geopunt,項目名稱:geopunt4arcgis,代碼行數:35,代碼來源:catalogForm.cs

示例5: EnableFaytAndDropDownList

		public static void EnableFaytAndDropDownList(ComboBox comboBox, AutoCompleteStringCollection dataSource)
		{
			comboBox.AutoCompleteCustomSource = dataSource;
			comboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
			comboBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
			comboBox.DataSource = new BindingSource(dataSource, null);	//HACK: Stop combo boxes from staying in sync with one another
		}
開發者ID:BeigeBadger,項目名稱:WTadministration,代碼行數:7,代碼來源:Helpers.cs

示例6: MainWindow

        public MainWindow()
        {
            InitializeComponent();

            using (var db = new MySqlContext())
            {
                var permissions = from a in db.Permissions
                                  select a.Name;
                this.checkedListBox_permissions.Items.AddRange(permissions.ToArray());
                this.checkedListBox_modificar_permissions.Items.AddRange(permissions.ToArray());

                var users = from b in db.LoginModels
                            select b.User;
                this.checkedListBox_users.Items.AddRange(users.ToArray());
                this.checkedListBox_modificar_users.Items.AddRange(users.ToArray());

                var roles = from r in db.Roles
                            select r.Name;
                AutoCompleteStringCollection accl = new AutoCompleteStringCollection();
                accl.AddRange(roles.ToArray());

                txt_rol_nombre.AutoCompleteMode = AutoCompleteMode.Suggest;
                txt_rol_nombre.AutoCompleteCustomSource = accl;
                txt_rol_nombre.AutoCompleteSource = AutoCompleteSource.CustomSource;

                txt_modificar_nombre.AutoCompleteMode = AutoCompleteMode.Suggest;
                txt_modificar_nombre.AutoCompleteCustomSource = accl;
                txt_modificar_nombre.AutoCompleteSource = AutoCompleteSource.CustomSource;

            }
        }
開發者ID:rafareyes7,項目名稱:UnifyWS,代碼行數:31,代碼來源:MainWindow.cs

示例7: AutoComplete_Init

        //オートコンプリートの初期化
        public void AutoComplete_Init(TextBox tbx, string filename)
        {
            //オートコンプリート用インスタンス生成
            AutoCompleteStringCollection auto_scs = new AutoCompleteStringCollection();
            tbx.AutoCompleteCustomSource = auto_scs;

            string directory = Environment.GetEnvironmentVariable("LOCALAPPDATA") + "\\SCV";

            //iniファイル用ディレクトリの確認
            if (Directory.Exists(directory) == false)
            {
                DirectoryInfo di = Directory.CreateDirectory(directory);
            }

            //保存用 ini ファイルの読込/作成
            if (File.Exists(filename) == false)
            {
                FileStream fs = File.Create(filename);
                fs.Close();
            }

            //読み込んだファイル內容の反映
            foreach (string row in File.ReadLines(filename, SJIS))
            {
                auto_scs.Add(row);
            }
        }
開發者ID:OkaMisato,項目名稱:test,代碼行數:28,代碼來源:cls_scv.cs

示例8: AutoComplete_Init

        //オートコンプリートの初期化
        public void AutoComplete_Init(TextBox tbx, string filename)
        {
            //オートコンプリート用インスタンス生成
            AutoCompleteStringCollection auto_scs = new AutoCompleteStringCollection();
            tbx.AutoCompleteCustomSource = auto_scs;

            string directory = Environment.GetEnvironmentVariable("LOCALAPPDATA") + "\\SCV";

            //保存用 ini ファイルの読込/作成
            if (File.Exists(filename) == false)
            {
                FileStream fs = File.Create(filename);
                fs.Close();
            }

            //読み込んだファイル內容をパスワードを復號化し反映
            foreach (string row in File.ReadLines(filename, SJIS))
            {
                auto_scs.Add(Decrypt(row));
            }


            //ファイルのサイズを取得
            System.IO.FileInfo fi = new System.IO.FileInfo(filename);
            long filesize = fi.Length;
            //ファイルの中身が空ではない場合、テキストボックスに初期値を追記
            if (filesize != 0)
            {
                //テキストファイルからすべての行を読み込む
                string[] lines = System.IO.File.ReadAllLines(filename);
                //最終行の値を追記                
                tbx.Text = (Decrypt(lines[lines.Length - 1]));
            }

        }
開發者ID:OkaTest,項目名稱:J-s-Communication-Co.-Ltd.,代碼行數:36,代碼來源:PassClass.cs

示例9: FillTheCustomerInfo

        public void FillTheCustomerInfo(custVendor.CustVendorManager.custvendorinfo custInfo)
        {
            AutoCompleteStringCollection contactSource = new AutoCompleteStringCollection();
            if (custInfo.contact1.Length!=0)
            {
                tbContact.Text = custInfo.contact1;
                contactSource.Add(custInfo.contact1);
            }
            if (custInfo.contact2.Length!=0)
            {
                contactSource.Add(custInfo.contact2);
            }
            tbContact.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            tbContact.AutoCompleteSource = AutoCompleteSource.CustomSource;
            tbContact.AutoCompleteCustomSource = contactSource;

            tbCustomerAccount.Text = custInfo.cvnumber;
            tbFreightTerm.Text = custInfo.shippingTerm;
            tbPaymentTerm.Text = custInfo.paymentTerm;
            tbBillto.Text = custInfo.billTo;

            List<custVendor.CustVendorManager.custvendorinfoshipto> shipToList = custVendor.CustVendorManager.CustVenInfoManager.GetShipTo(custInfo.cvId);
            List<string> shipToListString = new List<string>();
            foreach (custVendor.CustVendorManager.custvendorinfoshipto shipto in shipToList)
            {
                shipToListString.Add(shipto.shipTo);
            }
               SetShipToList(shipToListString);
        }
開發者ID:phox,項目名稱:AmbleSystem,代碼行數:29,代碼來源:SoViewControl.cs

示例10: searchDepartmentalHeads

        // Search departmental heads
        public void searchDepartmentalHeads()
        {
            searchDepartmentalHeadStaffIdTextBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            searchDepartmentalHeadStaffIdTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection collection = new AutoCompleteStringCollection();

            sqlConnection = new MySqlConnection(databaseConnection);

            try
            {
                sqlConnection.Open();

                MySqlCommand sqlCommand = new MySqlCommand("SELECT * FROM departmental_heads", sqlConnection);
                MySqlDataReader reader = sqlCommand.ExecuteReader();
                while (reader.Read())
                {
                    String name = reader.GetInt64("pfno").ToString();
                    collection.Add(name);
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("Error has occured while seraching departmental head, : " + exception.Message);
            }

            searchDepartmentalHeadStaffIdTextBox.AutoCompleteCustomSource = collection;
        }
開發者ID:sammir,項目名稱:Human-Resource-Information-Management-System,代碼行數:28,代碼來源:DepartmentalHead.cs

示例11: SetupElements

		private void SetupElements(NationSelectForm nationSelectForm, Nation selectedNation, int numberOfCrewSlots)
		{
			_nationSelectForm = nationSelectForm;
			_selectedNation = selectedNation;
			_numberOfCrewSlots = numberOfCrewSlots;
			_vehicleType = new VehicleType();	// Crappy default value
			_crewSlotData = Helpers.LoadCrewSlotDataFromFile(CrewSlotDataFileName) ?? new List<CrewSlotData>();	// Load from file, if null is returned, creates a new (empty) list

			if (_crewSlotData.Count < 1) // Happens only when nothing comes from reading the file with data.
			{
				_crewSlotData.Add(new CrewSlotData(_selectedNation));
			}

			#region Setup fields for form controls
			List<string> vehicleNames = Helpers.LoadVehicleDataFromJson(Helpers.GetVehicleJsonDataForNation(_selectedNation)).OrderBy(v => v.VehicleName).Select(v => v.VehicleName).ToList();
			_faytVehicleSource = new AutoCompleteStringCollection();
			_faytVehicleSource.AddRange(vehicleNames.ToArray());

			List<string> vehicleTypes = Helpers.LoadVehicleTypesDataFromJson(Helpers.GetVehicleTypesJsonData()).OrderBy(t => t.VehicleTypeLongName).Select(t => t.VehicleTypeLongName).ToList();
			_faytVehicleTypeSource = new AutoCompleteStringCollection();
			_faytVehicleTypeSource.AddRange(vehicleTypes.ToArray());

			_crewSlotConfigurations = new List<CrewSlotConfiguration>();
			_crewSlotGroupBoxes = new Dictionary<int, GroupBox>();
			_crewNameComboBoxes = new Dictionary<int, ComboBox>();
			_crewTrainedMembersNumericScrollers = new Dictionary<int, NumericUpDown>();
			_crewVehicleTypeComboBoxes = new Dictionary<int, ComboBox>();
			#endregion

			SetFormHeight();
			Helpers.ChangeBackground(this, selectedNation);
			PopulateFormControls();
		}
開發者ID:BeigeBadger,項目名稱:WTadministration,代碼行數:33,代碼來源:ConfigureCrewSlotsForm.cs

示例12: AutoCompleteAnimalSerial

        private void AutoCompleteAnimalSerial()
        {
            //auto completes Employee name in check out page.
            textBoxTreatmentSerial.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            textBoxTreatmentSerial.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection collection1 = new AutoCompleteStringCollection();

            textBoxFoodAnimalSerial.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            textBoxFoodAnimalSerial.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection collection2 = new AutoCompleteStringCollection();

            SqlConnection connection = new SqlConnection(connectionString);
            string commandString = "SELECT aserial FROM animal";
            SqlCommand command = new SqlCommand(commandString, connection);
            SqlDataReader myReader;
            try
            {
                connection.Open();
                myReader = command.ExecuteReader();
                while (myReader.Read())
                {
                    string value = myReader["aserial"].ToString();
                    collection1.Add(value);
                    collection2.Add(value);
                }
                connection.Close();
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
            textBoxTreatmentSerial.AutoCompleteCustomSource = collection1;
            textBoxFoodAnimalSerial.AutoCompleteCustomSource = collection2;
            NameShadeShow();
        }
開發者ID:kanizkoly,項目名稱:ZooManagementSystem,代碼行數:35,代碼來源:AdminWork.cs

示例13: FindObjectForm_Shown

        /// <summary>The find object form_ shown.</summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        private void FindObjectForm_Shown(object sender, EventArgs e)
        {
            var collection = new AutoCompleteStringCollection();

            try
            {
                UseWaitCursor = true;

                if (_databaseInspector.DbSchema == null)
                {
                    _databaseInspector.LoadDatabaseDetails();
                }

                foreach (DbModelTable table in _databaseInspector.DbSchema.Tables)
                {
                    collection.Add(table.FullName);
                }

                foreach (DbModelView view in _databaseInspector.DbSchema.Views)
                {
                    collection.Add(view.FullName);
                }
            }
            finally
            {
                UseWaitCursor = false;
            }

            cboObjects.AutoCompleteCustomSource = collection;
        }
開發者ID:SyedMdKamruzzaman,項目名稱:sap_interface,代碼行數:33,代碼來源:FindObjectForm.cs

示例14: Initialize

 public void Initialize()
 {
     SetFormHeader();
     AutoCompleteStringCollection cmbstrName = new AutoCompleteStringCollection();
     AutoCompleteStringCollection cmbstrJer = new AutoCompleteStringCollection();
     DataRow drTeam = ObjUdtprovider.CurrentDataSet.Tables[2].Select("Name = '" + Team+"'").FirstOrDefault();
     if (drTeam != null)
     {
         DataRow[] drPlayers = ObjUdtprovider.CurrentDataSet.Tables[3].Select("T24_ID = '" + drTeam["T24_ID"] + "' AND Playing=true");
         cmbPlayerJer.Items.Clear();
         cmbPlayerName.Items.Clear();
         foreach (DataRow item in drPlayers)
         {
             cmbPlayerName.Items.Add(item["First Name"]);
             cmbstrName.Add(item["First Name"].ToString());
             cmbPlayerJer.Items.Add(item["Jersey No"]);
             cmbstrJer.Add(item["Jersey No"].ToString());
         }
         cmbPlayerName.SelectedIndex = 1;
         cmbPlayerJer.SelectedIndex = 1;
         cmbPlayerName.AutoCompleteMode = AutoCompleteMode.Suggest;
         cmbPlayerName.AutoCompleteSource = AutoCompleteSource.CustomSource;
         cmbPlayerName.AutoCompleteCustomSource = cmbstrName;
         cmbPlayerJer.AutoCompleteMode = AutoCompleteMode.Suggest;
         cmbPlayerJer.AutoCompleteSource = AutoCompleteSource.CustomSource;
         cmbPlayerJer.AutoCompleteCustomSource = cmbstrJer;
     }
 }
開發者ID:WASP3D,項目名稱:Soccer-App,代碼行數:28,代碼來源:PlayerDetails.cs

示例15: textBox1_TextChanged_1

        private void textBox1_TextChanged_1(object sender, EventArgs e)
        {
            AutoCompleteStringCollection names = new AutoCompleteStringCollection();
            textBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
            textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
            string server = "MYSQL5009.HostBuddy.com";
            string database = "db_9cf135_hawk";
            string uid = "9cf135_hawk";
            string password = "ticcttmosfet";
            string connectionString;
            connectionString = "SERVER=" + server + ";" + "DATABASE=" +
            database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";
            MySqlConnection con = new MySqlConnection(connectionString);
            con.Open();
            MySqlCommand cms = new MySqlCommand("select * from user", con);
            MySqlDataReader dr = cms.ExecuteReader();
            while (dr.Read())
            {
                names.Add(dr[1].ToString());
            }

            dr.Close();
            con.Close();
            textBox1.AutoCompleteCustomSource = names;
        }
開發者ID:prab409069,項目名稱:vision,代碼行數:25,代碼來源:name.cs


注:本文中的System.Windows.Forms.AutoCompleteStringCollection類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。