📄 gridctrllist.shtml.htm
字号:
<HTML>
<!-- Header information-->
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Author" CONTENT="Chris Maunder">
<TITLE>Controls - MFC Grid control with drop down lists</TITLE>
</HEAD>
<!-- Set background properties -->
<body background="../fancyhome/back.gif" tppabs="http://www.codeguru.com/fancyhome/back.gif" bgcolor="#FFFFFF" link="#B50029" vlink="#8E2323" alink="#FF0000">
<!-- A word from our sponsors... -->
<table WIDTH="100%">
<tr WIDTH="100%"><td><A HREF="http://209.66.99.126/cgi/ads.cgi?advert=catalyst"><IMG SRC="../banners/catalyst.jpg" tppabs="http://www.codeguru.com/banners/catalyst.jpg" HEIGHT=60 WIDTH=468 ALT="Catalyst Development" BORDER=2></A><BR><SMALL><A HREF="http://209.66.99.126/cgi/ads.cgi?advert=catalyst">Click here for Free ActiveX Control</A></SMALL><td></tr>
</table>
<!-- Article Title -->
<CENTER><H3><FONT COLOR="#AOAO99">
MFC Grid control with drop down lists
</FONT></H3></CENTER>
<CENTER><H3><HR></H3></CENTER>
<!-- Author and contact details -->
This article was contributed by <A HREF="mailto:korpro@actcom.co.il">Motty Cohen</A>.
<!-- Sample image and source code/demo project -->
<P>
<IMG SRC="gridctrllist.gif" tppabs="http://www.codeguru.com/controls/gridctrllist.gif" WIDTH=390 HEIGHT=234 HSPACE=12>
Download <A HREF="gridctrllist.zip" tppabs="http://www.codeguru.com/controls/gridctrllist.zip">Source code</a> and
<A HREF="gridctrllistdemo.zip" tppabs="http://www.codeguru.com/controls/gridctrllistdemo.zip">demo project</A>
</p>
<br>
<!-- The article... -->
<p>This is a previous version of Chris Maunder抯 <a href="GridCtrl.shtml.htm" tppabs="http://www.codeguru.com/controls/GridCtrl.shtml">MFC Grid control
</a> (version 1.03) with a minor bug fix and several improvements.</P>
<p>First a bug fix:
<li>In some situations I have managed to edit cells in fixed column, so I added a line in
OnEditCell() Event handler to prevent it:
<FONT COLOR="#990000"><TT><PRE> if ((nRow < m_nFixedRows)||(nCol < m_nFixedCols)) return;
</tt></PRE></FONT>
<br><br>
<p>And the improvements:
<ul>
<LI>I had the need to delete all rows but without the fixed rows and all the column
attributes (see section 3), so I add function DeleteAllRows().</li><br><br>
<LI>I added an UINT array: <FONT COLOR="#990000"><TT><PRE>m_arColType</tt></PRE></FONT>
This array holds the Edit Type for each column. This Edit Type can take one of these
values:<BR>
<ul>
<li>GVET_NOEDIT (0x0000)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -