Example #1
0
 private void btnFromMap_Click(object sender, EventArgs e)
 {
     Hashtable ht = new Hashtable();
     ht.Clear();
     SearchLocation sl2 = new SearchLocation(ht);
     Button btnSelect = new Button();
     TextBox tbText = new TextBox();
     tbText.MaxLength = 16384;
     btnSelect.Click += (a, b) => {
         sl2.Close();
         foreach (string strall in tbText.Text.Split('|'))
         {
             if (!string.IsNullOrEmpty(strall))
             {
                 string[] strs = strall.Split(';');
                 if (strs.Length >= 3)
                 {
                     string strPath = strs[0].Replace("/srv/samba/share/", "\\\\ubuntu\\share$\\").Replace("/", "\\").Replace("%20", " ");
                     savePosInfo(strPath, "", strs[1], strs[2]);
                 }
             }
         }
     };
     ht.Add("Import", btnSelect);
     ht.Add("Text", tbText);
     sl2 = new SearchLocation(ht);
     sl2.StartPosition = FormStartPosition.CenterParent;
     sl2.Left = this.Left + 200;
     sl2.Top = this.Top + 200;
     sl2.Width = 100;
     sl2.Height = 120;
     DialogResult dr = sl2.ShowDialog();
 }
Example #2
0
        private void button8_Click(object sender, EventArgs e)
        {
            Hashtable ht = new Hashtable();
            ht.Clear();
            ht.Add("City", new TextBox());
            ht.Add("Country", new TextBox());
            Button btnSelect = new Button();
            btnSelect.Click += new EventHandler(btnSelect_Click);
            ht.Add("Select", btnSelect);
            Button btnSearch = new Button();
            btnSearch.Click += new EventHandler(btnSearch_Click);
            ht.Add("Search", btnSearch);
            sl = new SearchLocation(ht);
            sl.StartPosition = FormStartPosition.CenterParent;
            sl.Left = this.Left + 200;
            sl.Top = this.Top + 200;
            sl.Width = 310;
            sl.Height = 150;
            DialogResult dr = sl.ShowDialog();

        }