问题描述
我正在尝试创建,这样,当我单击人民币时,会创建一个下拉列表/菜单。我对下拉菜单的定义将在下面附上。我被事件处理程序困住了,我过滤掉了甚至是LMB或RMB,然后我在这里遇到了问题。
首先,我的要求是,当我单击“人民币”时我已经设计了一张地图,我需要一个下拉菜单,以便选择合适的选项。
我的下拉列表定义
this.UserControl_MissionPlan_MapPanel_MourseRightClick = new ComboBox();
this.UserControl_MissionPlan_MapPanel_MourseRightClick.Location = new System.Drawing.Point(700,700);
this.UserControl_MissionPlan_MapPanel_MourseRightClick.Size = new System.Drawing.Size(120,120);
this.UserControl_MissionPlan_MapPanel_MourseRightClick.DropDownStyle = ComboBoxStyle.DropDownList;
this.UserControl_MissionPlan_MapPanel_MourseRightClick.MaxLength = 5;
this.UserControl_MissionPlan_MapPanel_MourseRightClick.Items.Add(1);
this.UserControl_MissionPlan_MapPanel_MourseRightClick.Items.Add(2);
this.UserControl_MissionPlan_MapPanel_MourseRightClick.Items.Add(3);
this.UserControl_MissionPlan_MapPanel_MourseRightClick.Items.Add(4);
this.UserControl_MissionPlan_MapPanel_MourseRightClick.Items.Add(5);
最后是我的事件处理程序
private void UserControl_MissionPlan_MapPanel_MouseClick(object sender,MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Left)
{
double WaypointLatitude = UserControl_MissionPlan_MapPanel.FromLocalToLatLng(e.X,e.Y).Lat;
double WaypointLongitude = UserControl_MissionPlan_MapPanel.FromLocalToLatLng(e.X,e.Y).Lng;
// MessageBox.Show(Convert.ToString(WaypointLatitude));
// MessageBox.Show(Convert.ToString(WaypointLongitude));
// GMapOverlay NavigationWayPoint = new GMapOverlay("NavigationWayPoint");
// GMapMarker WayPoint = new GMarkerGoogle(new PointLatLng(WaypointLatitude,WaypointLongitude),GMarkerGoogleType.orange_small);
// NavigationWayPoint.Markers.Add(WayPoint);
// UserControl_MissionPlan_MapPanel.Overlays.Add(NavigationWayPoint);
}
else if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
// MessageBox.Show("Right Mouse button Mouse clicked");
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)