📄 formedittable.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace EditMyTable2
{
public partial class FormEditTable : Form
{
public FormEditTable()
{
InitializeComponent();
}
private void myTable2BindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.myTable2BindingSource.EndEdit();
this.myTable2TableAdapter.Update(this.myDatabaseDataSet.MyTable2);
}
private void FormEditSingleTable_Load(object sender, EventArgs e)
{
// TODO: 这行代码将数据加载到表“myDatabaseDataSet.MyTable1”中。您可以根据需要移动或移除它。
this.myTable1TableAdapter.Fill(this.myDatabaseDataSet.MyTable1);
// TODO: 这行代码将数据加载到表“myDatabaseDataSet.MyTable2”中。您可以根据需要移动或移除它。
this.myTable2TableAdapter.Fill(this.myDatabaseDataSet.MyTable2);
}
private void buttonImportPhoto_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
//根据打开的图像文件创建原始图像大小的Bitmap对象
Bitmap image = new Bitmap(openFileDialog1.FileName);
//按比例缩放显示(因为Picture的SizeMode属性为Zoom),但原始图像大小未变
pictureBoxPhoto.Image = image;
}
}
private void buttonRetatePhoto_Click(object sender, EventArgs e)
{
if (pictureBoxPhoto.Image != null)
{
//旋转90度
pictureBoxPhoto.Image.RotateFlip(RotateFlipType.Rotate90FlipNone);
pictureBoxPhoto.Invalidate();
}
}
private void buttonClearPhoto_Click(object sender, EventArgs e)
{
pictureBoxPhoto.Image = null;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -