datagridnoactivecellcolumn.h

来自「Visual C++.net数据库开发经典案例」· C头文件 代码 · 共 65 行

H
65
字号
#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Diagnostics;
using namespace System::Drawing;
using namespace System::Windows::Forms;

 
namespace My
{
	/// <summary> 
	/// DataGridNoActiveCellColumn 摘要
	/// </summary>
	__gc public class DataGridNoActiveCellColumn :  public System::Windows::Forms::DataGridTextBoxColumn
	{
	public:
		DataGridNoActiveCellColumn(void)
		{
			InitializeComponent();
		}
		DataGridNoActiveCellColumn(System::ComponentModel::IContainer *container) : components(0)
		{
			/// <summary>
			/// Windows.Forms 类撰写设计器支持所必需的
			/// </summary>

			container->Add(this);
			InitializeComponent();
		}
		
	protected: 
		void Dispose(Boolean disposing)
		{
			if (disposing && components)
			{
				components->Dispose();
			}
			__super::Dispose(disposing);
		}
				
	private:
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		System::ComponentModel::Container *components;
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要用代码编辑器
		///修改此方法的内容。
		/// </summary>	
		void InitializeComponent(void)
		{
			components = new System::ComponentModel::Container();
		}
	protected:
		void Edit(CurrencyManager* source, int rowNum, Rectangle bounds, bool readOnly, String* instantText, bool cellIsVisible)
		{
			int SelectedRow = rowNum;
			this->DataGridTableStyle->DataGrid->Select(SelectedRow);
		}
	};
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?