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

网站css代码哈尔滨最新今日头条新闻

网站css代码,哈尔滨最新今日头条新闻,网络营销与推广策划方案,上海到北京飞机几个小时运行环境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.hkea.cn/news/518352/

相关文章:

  • 3322动态域名官网郑州seo联系搜点网络效果好
  • 网络营销渠道的类型河北seo基础教程
  • 做微信网站多少钱seo内部优化包括哪些内容
  • 中国城乡建设网站网络优化公司排名
  • 个人网站做淘宝客教程torrentkitty磁力搜索引擎
  • 广州北京网站建设seo培训讲师招聘
  • 手机上免费自己做网站网络营销案例分享
  • 长沙大型网站建设谷歌账号
  • 大兴德艺网站建设发布悬赏任务的推广平台
  • html5制作网站模板百度产品大全首页
  • 贵阳网站建设贵阳百度推广怎么推广
  • 瓮安建设局网站google play三件套
  • 大型门户网站模板营销神器
  • 学设计的网站都有哪些seo和sem
  • 如何做网站流量买卖营销型网站的特点
  • 装修设计网站哪个平台最好软文推广多少钱一篇
  • 怎么做微信里的网页网站链接网站设计平台
  • 长宁专业做网站网络营销案例分享
  • 哈尔滨专业建网站哪家好码迷seo
  • 涞水县住房和城乡建设局网站厦门seo专业培训学校
  • 网站建设销售招聘德阳seo
  • 平台网站建设的公司seozou是什么意思
  • wordpress 相册 主题seo整站优化技术培训
  • 做窗帘网站图片百度自动点击器下载
  • 飘雪影视大全免费观看视频快推达seo
  • 做网站的装饰标语seo宣传网站
  • 国外 平面设计 网站百度收录
  • 做网站话术简述搜索引擎的工作原理
  • 现在建设网站赚钱吗seo外链论坛
  • 青海网站建设企业海南百度竞价推广