DataGrid Control, EditText Control
2012-11-28 13:09
218 查看
DataGrid Control, EditText Control
By IlyasovAM,26 Feb 2007
μ 1.64, σa 2.80 [?] |
Is your email address OK? You are signed up for our newsletters but your
email address is either unconfirmed, or has not been reconfirmed in a long time. Please click
here to have a confirmation email sent so we can confirm your email address and start sending you newsletters again. Alternatively, you can
update your subscriptions.
Download DataGridDemo.zip - 122.9 KB
Introduction
This article presents a DataGrid control which is built with no MFC, no C++. It can be used in SDK or MFC Win32 applications.Background
You can find various grid controls all over the Internet, some free and some not. The DataGrid control is attempt of realization of datagrid like msdatgrd.ocx from VB 6.0 with no ActiveX interface.Using the code
To use this code you must define your datasource and register the following function:Collapse |
Copy Code
1. int GetRecordCount( void ) 2. int GetCountColumns( void ) 3. char* GetColumnName( iIndexColumn ) 4. char* GetValue( int iNumRow, int iNumField ) 5. void SetValue( int iNumRow, int iNumField, char *szValue ) FARPROC fn; fn=GetProcAddress( (HMODULE)hInstDLL, "DataGridFrameRegisterDataFunction" ); DataGridFrameRegisterDataFunction=(TDataGridFrameRegisterDataFunction)fn; iRes=(*DataGridFrameRegisterDataFunction)(&ODBCGetRecordCount, &ODBCGetCountColumns,&ODBCGetColumnName,&ODBCGetValue, &ODBCSetValue); if( iRes==0 ) { ... }
If your datasource is insertable set
bInsert=TRUE, if deletable set
bDelete=TRUE, if updatable set
bUpdate=TRUE. Then
Collapse |
Copy Code
fn=GetProcAddress( (HMODULE)hInstDLL, "DataGridSetDataAttribs" ); DataGridSetDataAttribs=(TDataGridSetDataAttribs)fn; iRes=(*DataGridSetDataAttribs)( bInsert, bDelete, bUpdate ); if( iRes==0 ) { ... }
If you want to catch events, you should define and register handlers.
Collapse |
Copy Code
fn=GetProcAddress( (HMODULE)hInstDLL, "DataGridSetEvents" ); DataGridSetEvents=(TDataGridSetEvents)fn; iRes=(*DataGridSetEvents)( &OnHeadClick, &OnRowColChange, &OnAfterDelete, &OnBeforeColEdit );
See source code for details.
License
This article, along with any associated source code and files, is licensed underThe Code Project Open License (CPOL)
About the Author
IlyasovAM Russian Federation Member |
相关文章推荐
- Edit Control with Icon and Background Text
- Text Edit control - Usage and Demo
- Vertical Text Centering in an Edit Control(CEdit 单行 垂直居中)
- text edit control using function
- Edit Control with Icon and Background Text
- Edit Control: How to append text to an edit control?
- Edit Control with Icon and Background Text
- CRichEditControl50W - A VC++ Rich Text Edit 4.1 MFC Control
- MFC控件(2):Text_Edit_Control
- Delphi,Rxlib,RxRichEdit,Richedit 高版本 ,Rich Text Edit Control, v4.1 控件,打印Bug
- MFC控件(2):Text_Edit_Control
- edittext实现显示千分位格式
- android 首选项 EditTextPreference
- Android取消EditText自动获取焦点默认行为
- 让EditText不能自动获取焦点
- android开发中控件editText对应的inputType的类型总结
- Android笔记:小记——锁定当前Activity屏幕方向、EditText自定义背景、Activity跳转到Fragment、隐藏键盘
- adapter edittext
- EditText 和 TextView 的属性详解