加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
DetailForm.cs 2.49 KB
一键复制 编辑 原始数据 按行查看 历史
amyoubo 提交于 2024-06-23 17:07 . splitContainer1宽度设置优化
using System;
using System.Windows.Forms;
namespace GZPAssist
{
public partial class DetailForm : Form
{
private TransSheBeiFXandGXBetweenForm fxgxDelegate = null;
private SingleShebeiGongxuFengxian ModifiedSheBeiFXGX = new SingleShebeiGongxuFengxian();
public DetailForm(TransSheBeiFXandGXBetweenForm data, SingleShebeiGongxuFengxian ssgf)
{
InitializeComponent();
this.fxgxDelegate = data;
ModifiedSheBeiFXGX = ssgf;
textBox1.Text = ssgf.CombinSheBeiGongXu;
richTextBox1.Text = ssgf.FangFanCuoShi;
richTextBox2.Text = ssgf.ZhiLiangDian;
richTextBox3.Text = ssgf.HouGuo;
foreach (Control tc in panel8.Controls)
{
if ((tc is RadioButton) && (tc as RadioButton).Text.Contains(ssgf.RiskLevel))
{
(tc as RadioButton).Checked=true;
}
}
}
private void button1_Click(object sender, EventArgs e)
{
//都是对对象的引用,所以此处修改后可以直接修改globalVar.TDGZPConfig.AllSheBeiType中的文本
ModifiedSheBeiFXGX.CombinSheBeiGongXu = textBox1.Text;
ModifiedSheBeiFXGX.FangFanCuoShi = richTextBox1.Text;
ModifiedSheBeiFXGX.ZhiLiangDian = richTextBox2.Text;
foreach (Control tc in panel8.Controls)
{
if ((tc is RadioButton) && (tc as RadioButton).Checked)
{
ModifiedSheBeiFXGX.RiskLevel=(tc as RadioButton).Text;
}
}
this.Close();
}
private void DetailForm_FormClosing(object sender, FormClosingEventArgs e)
{
//this.fxgxDelegate(ModifiedSheBeiFXGX);
}
private void DetailForm_Shown(object sender, EventArgs e)
{
//关闭自动选词,在[设计]AutoWordSelection属性设置是没办法关闭的,这算一个小BUG
richTextBox1.AutoWordSelection = false;
richTextBox2.AutoWordSelection = false;
richTextBox3.AutoWordSelection = false;
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void richTextBox2_Layout(object sender, LayoutEventArgs e)
{
splitContainer1.SplitterDistance = splitContainer1.Width - (splitContainer1.Width - panel8.Width) / 2;
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化