示例#1
0
 private void txtSearch_Properties_ButtonClick(object sender, ButtonPressedEventArgs e)
 {
     if (!string.IsNullOrEmpty(txtSearch.Text))
     {
         var txt = TaxiReturn_Process.Search(txtSearch.Text);
         if (txt != null)
         {
             MainMap.Position = new PointLatLng(txt.Value.Key, txt.Value.Value);
             if (AddMarkerRed == null)
             {
                 AddMarkerRed = MainMap.AddMarkerRed(MainMap.Position);
             }
             else
             {
                 AddMarkerRed.Position = MainMap.Position;
             }
             MainMap.Zoom = 16;
         }
         else
         {
             new MessageBox.MessageBoxBA().Show("Không tìm thấy địa chỉ");
         }
     }
 }
示例#2
0
 private void txtSearch_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyData == Keys.Enter)
     {
         var txt = TaxiReturn_Process.Search(txtSearch.Text);
         if (txt != null)
         {
             MainMap.Position = new PointLatLng(txt.Value.Key, txt.Value.Value);
             if (AddMarkerRed == null)
             {
                 AddMarkerRed = MainMap.AddMarkerRed(MainMap.Position);
             }
             else
             {
                 AddMarkerRed.Position = MainMap.Position;
             }
             MainMap.Zoom = 16;
         }
         else
         {
             new MessageBox.MessageBoxBA().Show("Không tìm thấy địa chỉ");
         }
     }
 }