当前位置: 首页 > news >正文

西安网站维护推广商城网站建设自助建站平台

西安网站维护推广,商城网站建设自助建站平台,开发三味风车动漫无修,怎么找人帮做网站运行环境Visual Studio 2022 c# cad2016 一、模态窗体调用方式: 当一个模态窗体打开时,它会阻塞主窗体的所有输入,直到关闭该模态窗体为止。例如,弹出一个对话框让用户必须完成某些操作后才能继续使用主程序。 [CommandMethod(&q…

 运行环境Visual Studio 2022 c# cad2016

一、模态窗体调用方式
当一个模态窗体打开时,它会阻塞主窗体的所有输入,直到关闭该模态窗体为止。例如,弹出一个对话框让用户必须完成某些操作后才能继续使用主程序。

[CommandMethod("Caidan")]
public void Caidan()
{ShowModalLayerSelectionForm();//模态窗体}
//模态窗体private void ShowModalLayerSelectionForm(){using (var layerForm = new Form1()){DialogResult result = layerForm.ShowDialog(); // 使用ShowDialog()方法打开模态窗体if (result == DialogResult.OK || result == DialogResult.Yes) // 根据需要处理结果{// 处理用户选择图层的操作...}}}

二、非模态窗体调用方式

非模态窗体打开时,用户可以同时与主窗体和其他非模态窗体进行交互。通常用作工具栏、辅助信息显示窗口等。

[CommandMethod("Caidan")]
public void Caidan()
{Form1 选择图层 = new Form1(); //非模态窗体选择图层.Show();
}

三、窗体程序

     this.MaximizeBox = false;this.MinimizeBox = false;// 初始化DataGridViewDataGridView dataGridView = new DataGridView();// 创建一个新的DataGridView控件实例dataGridView.AllowUserToAddRows = false;// 禁止用户通过DataGridView界面直接添加新行dataGridView.AllowUserToDeleteRows = false;// 禁止用户通过DataGridView界面删除现有行dataGridView.BackgroundColor = Color.White;// 设置DataGridView的背景颜色为白色dataGridView.CellBorderStyle = DataGridViewCellBorderStyle.Single;// 设置单元格边框样式为单线边框dataGridView.DefaultCellStyle.SelectionBackColor = Color.LightBlue;// 设置选中单元格时的背景色为浅蓝色dataGridView.DefaultCellStyle.SelectionForeColor = Color.Black;// 设置选中单元格时的前景色(文本颜色)为黑色// 添加图层名称列DataGridViewTextBoxColumn layerNameColumn = new DataGridViewTextBoxColumn();layerNameColumn.HeaderText = "图层名称";layerNameColumn.ReadOnly = true;dataGridView.Columns.Add(layerNameColumn);// 假设GetLayerList返回CAD图层的名称列表//List<string> layerNames = GetLayerList();foreach (LayerTableRecord layer in GetLayerList()){dataGridView.Rows.Add(layer.Name);}// 添加DataGridView到窗体this.Controls.Add(dataGridView);dataGridView.Dock = DockStyle.Fill;dataGridView.CellDoubleClick += DataGridView_CellDoubleClick;
}private void DataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{if (sender is DataGridView dgv && e.RowIndex >= 0) // 检查是否在有效的行上双击{string selectedLayerName = dgv.Rows[e.RowIndex].Cells[0].Value.ToString(); // 获取选中的图层名称// 处理双击选定图层的逻辑MessageBox.Show($"双击了图层:{selectedLayerName}");// 根据需求执行其他操作...}
}private IEnumerable<LayerTableRecord> GetLayerList()
{List<LayerTableRecord> layers = new List<LayerTableRecord>();using (Transaction tr = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction()){LayerTable layerTable = (LayerTable)tr.GetObject(HostApplicationServices.WorkingDatabase.LayerTableId, OpenMode.ForRead);foreach (ObjectId id in layerTable){LayerTableRecord layer = (LayerTableRecord)tr.GetObject(id, OpenMode.ForRead);layers.Add(layer);}tr.Commit();}return layers;
}

//感谢大家的点赞,收藏,转发,关注  

http://www.yayakq.cn/news/449736/

相关文章:

  • 郑州做招商的网站wordpress 设置显示中文
  • 做盗版小说网站犯法吗网页欢迎页面设计
  • 河南专业网站建设招聘东莞做网站首选
  • 个人网站推广江门企业免费建站
  • 正能量不良网站软件下载个人建设网站维护费是多少
  • 使用vue做的网站3g免费网站制作
  • 打开山东城市建设职业学院网站怎么自己建立一个网站
  • 网站建设 模块做网站最常用的软件是什么
  • 建晨网站建设有限公司新手编程入门先学什么
  • 中能建西北城市建设有限公司网站ip库网站源码
  • 电脑网站兼职在哪里做网站设计与维护
  • 网站关键词和描述自己做网站用花钱么
  • 2017主流网站开发语言企业进行网站建设的方式
  • 做个网站浏览有关小城镇建设的网站记录
  • python网站开发案例深圳外贸公司多吗
  • 郑州网站建设喝彩科技wordpress胖子马
  • 网站建设怎样创建链接活动策划书
  • 全国知名网站建设公司网站开发平面设计师岗位要求
  • 做网站流量赚钱西安关键词优化软件
  • 傻瓜网站开发软件wordpress 导入html
  • 注册建公司网站企业所得税缴纳标准
  • 招商网站建设多少钱logo设计公司报价
  • 则么做网站小程序app开发软件定制
  • 网站建设报价模块dns修改国外网站
  • 洒长春菩网站建设网站建设经费
  • 做网站的素材和步骤开发公司介绍
  • 专业的移动网站建设公宝丰网站建设
  • 网站设计师要求微信公众号怎么做网站的
  • 做团购网站商品从哪里找360免费建站系统
  • 如何学做网站wordpress 3无法上传rar zip