📄 productssummaryviewdialog.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace MobileDevelopersHandbook.DSAExample
{
public partial class ProductsSummaryViewDialog : Form
{
public ProductsSummaryViewDialog()
{
InitializeComponent();
// Attach event handlers to auto-hide controls.
this.AttachVisibilityBindings(this.Controls);
}
private void editMenuItemMenuItem_Click(object sender, EventArgs e)
{
MobileDevelopersHandbook.DSAExample.ProductsEditViewDialog productsEditViewDialog = MobileDevelopersHandbook.DSAExample.ProductsEditViewDialog.Instance(this.productsBindingSource);
productsEditViewDialog.ShowDialog();
this.Close();
}
private void ProductsSummaryViewDialog_KeyDown(object sender, KeyEventArgs e)
{
if ((e.KeyCode == System.Windows.Forms.Keys.Up))
{
this.AutoScrollPosition = new System.Drawing.Point(0, ((0 - this.AutoScrollPosition.Y)
- 16));
e.Handled = true;
}
if ((e.KeyCode == System.Windows.Forms.Keys.Down))
{
this.AutoScrollPosition = new System.Drawing.Point(0, ((0 - this.AutoScrollPosition.Y)
+ 16));
e.Handled = true;
}
if ((e.KeyCode == System.Windows.Forms.Keys.Up))
{
// Up
}
if ((e.KeyCode == System.Windows.Forms.Keys.Down))
{
// Down
}
if ((e.KeyCode == System.Windows.Forms.Keys.Left))
{
// Left
}
if ((e.KeyCode == System.Windows.Forms.Keys.Right))
{
// Right
}
if ((e.KeyCode == System.Windows.Forms.Keys.Enter))
{
// Enter
}
}
private void orderMenuItem_Click(object sender, EventArgs e)
{
OrdersResultSetResultSets.OrdersResultSet ordResultSet = new OrdersResultSetResultSets.OrdersResultSet();
using (ordResultSet)
{
ordResultSet.AddOrdersRecord(0, Int32.Parse(this.productIdLabel1.Text), 1);
OrderProductDialog dlg = new OrderProductDialog(ordResultSet);
if (dlg.ShowDialog() == DialogResult.Cancel)
{
// Delete the record we just added
ordResultSet.ReadLast();
ordResultSet.DeleteRecord();
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -