private void panelMain_MouseDown(object sender, MouseEventArgs e) { // register a click! int cityselected = comboCitySelect.SelectedIndex; if (e.Button == System.Windows.Forms.MouseButtons.Left) { if (!is_add_owner) { // we already have grid locations so activate location m_gridValues[m_mouseGridXLoc][m_mouseGridYLoc] = 254; GridBase newbase = new GridBase(m_mouseGridXLoc, m_mouseGridYLoc, m_mouseXLoc, m_mouseYLoc, cityselected); if (!BorderBases.Contains(newbase)) { BorderBases.Add(newbase); m_gridOwner[m_mouseGridXLoc][m_mouseGridYLoc] = Convert.ToByte(cityselected + 1); } RenderPanel(); } else { GridBase newowner = new GridBase(m_mouseGridXLoc, m_mouseGridYLoc, m_mouseXLoc, m_mouseYLoc, cityselected); if (!BorderOwners.Contains(newowner)) { BorderOwners.Add(newowner); m_gridOwner[m_mouseGridXLoc][m_mouseGridYLoc] = Convert.ToByte(cityselected + 1); } RenderPanel(); } } }