private void Form1_Load(object sender, EventArgs e) { mi = Activator.CreateInstance(Type.GetTypeFromProgID("Mapinfo.Application")) as MapInfoApplication; panel1.Parent = tabPage1; panel2.Parent = tabPage1; panel3.Parent = tabPage2; panel4.Parent = tabPage2; panel5.Parent = tabPage2; panel6.Parent = tabPage2; // getting the border of each panel panel1_border = panel1.Handle.ToString(); panel2_border = panel2.Handle.ToString(); panel3_border = panel3.Handle.ToString(); panel4_border = panel4.Handle.ToString(); panel5_border = panel5.Handle.ToString(); panel6_border = panel6.Handle.ToString(); createWorkspace(panel1_border, ref windows1_id); createWorkspace(panel3_border, ref windows3_id); createWorkspace(panel4_border, ref windows4_id); // ----------part than handles the form---------------------------// int p = panel1.Handle.ToInt32(); mi.Do("dim p as object"); mi.Do("set map CoordSys Earth Projection 1, 28"); mi.SetCallback(callb); // callback'taki info cagiriyor. create info butotn in the background mi.Do("create buttonpad \"a\" as toolbutton calling OLE \"info\" id 2001"); }
private void Form1_Load(object sender, EventArgs e) { sidePanel.Height = turkey.Height; turkey.BackColor = selected; sidePanel.Top = turkey.Top; searchPanel.Visible = true; fullSize.BackgroundImage = CBSProjeTasarimTest.Properties.Resources.switch_to_full_screen_button__1_; //to load all Depended tables try { mi = new MapInfo.MapInfoApplication(); int p = map.Handle.ToInt32(); mi.Do("set next document parent " + p.ToString() + "style 1"); mi.Do("set application window " + p.ToString()); mi.Do("run application \"" + path + "\\Resources\\Databases\\haritalar2.WOR" + "\""); mi.Do("Set Map Zoom Entire Layer " + (layerSayisi - 1)); mi.Do("Set Map Layer " + (layerSayisi) + " Editable On"); mi.Do("Set Map Layer " + (layerSayisi) + " Editable On"); mi.SetCallback(callb); mi.Do("create buttonpad \"a\" as toolbutton calling OLE \"info\" id 2001"); tableProsses(); //Display all Hashtags getAllHashtags(); } catch (Exception) { string message = "There İs Some Problem With MapInfo Turkey Table\n Are You Sure to Close App?"; string caption = "Application Shut Down"; var result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { CloseMapInfo(); Form.ActiveForm.Close(); } else { Form1_Load(sender, e); } } }
private void Form1_Load(object sender, EventArgs e) { foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses()) { if (p.ProcessName == "MapInfow" & p.MainWindowTitle == "") { p.Kill(); } } mi = new MapInfoApplication(); int h = panel1.Handle.ToInt32(); mi.Do("Set Next Document Parent " + h.ToString() + " Style 1"); mi.Do("set application window " + h.ToString()); string ws_path = Application.StartupPath + "\\" + "default5.wor"; mi.Do("Run Application \"" + ws_path + "\""); gMainWinId = mi.Eval("windowid(0)"); mi.Do("create buttonpad \"a\" as toolbutton calling OLE \"info\" id 2001"); mi.Do("create buttonpad \"b\" as toolbutton calling OLE \"cizgiciz\" drawmode 33 id 2003"); mi.Do("create buttonpad \"c\" as toolbutton calling OLE \"noktaAt\" id 2004"); mi.Do("create buttonpad \"d\" as toolbutton calling OLE \"kapaliAlan\" drawmode 35 id 2005"); comboboxIller.Items.Clear(); mi.Do("select*from iller into sel noselect"); mi.Do("fetch first from sel"); for (int i = 0; i < Convert.ToInt16(mi.Eval("tableinfo(sel,8)")); i++) { comboboxIller.Items.Add(mi.Eval("sel.il_adi")); mi.Do("fetch next from sel"); } mi.SetCallback(callb); }