📄 csdn_文档中心_mfc编程中“占位符和动态创建”技巧的应用.htm
字号:
lang=EN-US>1</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的代码加入“动态创建”的代码,即在</SPAN><SPAN
lang=EN-US>Pictrue</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">控件的位置“动态创建”属性表以覆盖</SPAN><SPAN
lang=EN-US>Pictrue</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">控件,从而实现在对话框中嵌入属性表的目的。动态创建属性表如创建无模式对话框一样调用</SPAN><SPAN
lang=EN-US>Create()</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">函数,但必须指明</SPAN><I><SPAN
lang=EN-US>WS_CHILD</SPAN></I><I><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN
lang=EN-US>WS_VISIBLE</SPAN></I><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性,其余属性根据需要再行添加。另外在对话框中嵌入属性表时必须指定</SPAN><I><SPAN
lang=EN-US>WS_TABSTOP</SPAN></I><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><I><SPAN
lang=EN-US>WS_EX_CONTROLPARENT</SPAN></I><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性,从而使</SPAN><SPAN
lang=EN-US>TAB</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">键能顺利传递焦点。</SPAN></P>
<P class=MsoNormal
style="LINE-HEIGHT: 150%; TEXT-INDENT: 21pt"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">最后,需对属性表的有关控件进行数据交换,这可通过属性表数据成员、属性页的数据成员及</SPAN><I><SPAN
lang=EN-US>UpdateData</SPAN></I><I><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">()</SPAN></I><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">函数来完成。有关代码如下:</SPAN></P>
<P class=MsoNormal style="LINE-HEIGHT: 150%"><I><SPAN
lang=EN-US>//</SPAN></I><I><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在堆里生成对话框的属性表数据成员</SPAN><SPAN
lang=EN-US>m_pPropSheet</SPAN></I><I><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">并“动态创建”属性表“控件”;</SPAN><SPAN
lang=EN-US><o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="LINE-HEIGHT: 150%"><I><SPAN
lang=EN-US><SPAN
style="mso-tab-count: 1">
</SPAN>m_pPropSheet = new CQryPropSheet
(this);<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="LINE-HEIGHT: 150%"><I><SPAN
lang=EN-US><SPAN
style="mso-tab-count: 1">
</SPAN>if (! m_pPropSheet -> Create (this,WS_CHILD | WS_VISIBLE,
0)) {<o:p></o:p></SPAN></I></P>
<P class=MsoNormal
style="LINE-HEIGHT: 150%; TEXT-INDENT: 21pt"><I><SPAN
lang=EN-US><SPAN
style="mso-tab-count: 1">
</SPAN>delete m_pPropSheet;<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="LINE-HEIGHT: 150%"><I><SPAN
lang=EN-US><SPAN
style="mso-tab-count: 2">
</SPAN>m_pPropSheet = NULL;<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="LINE-HEIGHT: 150%"><I><SPAN
lang=EN-US><SPAN
style="mso-tab-count: 2">
</SPAN>return -1;<o:p></o:p></SPAN></I></P>
<P class=MsoNormal
style="LINE-HEIGHT: 150%; TEXT-INDENT: 21pt"><I><SPAN
lang=EN-US>}<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="LINE-HEIGHT: 150%"><I><SPAN
lang=EN-US>//</SPAN></I><I><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对属性表进行初始化,本例中对“包含子文件夹”复选框进行了初始化;</SPAN><SPAN
lang=EN-US><o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="LINE-HEIGHT: 150%"><I><SPAN
lang=EN-US><SPAN
style="mso-tab-count: 1">
</SPAN>m_pPropSheet -> m_Page1.m_bChildFolder =
TRUE;<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="LINE-HEIGHT: 150%"><I><SPAN
lang=EN-US><SPAN
style="mso-tab-count: 1">
</SPAN>m_pPropSheet -> m_Page1.UpdateData
(FALSE);<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="LINE-HEIGHT: 150%"><I><SPAN
lang=EN-US>//</SPAN></I><I><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">修改属性表属性使</SPAN><SPAN
lang=EN-US>TAB</SPAN></I><I><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">键能传递焦点,并且属性表能接受焦点;</SPAN><SPAN
lang=EN-US><o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="LINE-HEIGHT: 150%"><I><SPAN
lang=EN-US><SPAN
style="mso-tab-count: 1"> &<BR></SPAN></SPAN></I></P></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR>
<TABLE align=center bgColor=#006699 border=0 cellPadding=0 cellSpacing=0
width=770>
<TBODY>
<TR bgColor=#006699>
<TD align=middle bgColor=#006699 id=white><FONT
color=#ffffff>对该文的评论</FONT></TD>
<TD align=middle>
<SCRIPT src="CSDN_文档中心_MFC编程中“占位符和动态创建”技巧的应用.files/readnum.htm"></SCRIPT>
</TD></TR></TBODY></TABLE>
<TABLE align=center bgColor=#666666 border=0 cellPadding=2 cellSpacing=1
width=770>
<TBODY>
<TR>
<TD bgColor=#cccccc colSpan=3><SPAN style="COLOR: #cccccc"><IMG height=16
hspace=1 src="CSDN_文档中心_MFC编程中“占位符和动态创建”技巧的应用.files/ico_pencil.gif"
width=16> </SPAN> franksun <I>(2001-3-12
13:54:40)</I> </TD></TR>
<TR>
<TD bgColor=#ffffff colSpan=3 width=532><BR>很有创意 <BR></TD></TR></TBODY></TABLE>
<TABLE align=center bgColor=#666666 border=0 cellPadding=2 cellSpacing=1
width=770>
<TBODY>
<TR>
<TD bgColor=#cccccc colSpan=3><SPAN style="COLOR: #cccccc"><IMG height=16
hspace=1 src="CSDN_文档中心_MFC编程中“占位符和动态创建”技巧的应用.files/ico_pencil.gif"
width=16> </SPAN> csdnzyj <I>(2001-2-28
16:18:12)</I> </TD></TR>
<TR>
<TD bgColor=#ffffff colSpan=3 width=532><BR>很不错 <BR></TD></TR></TBODY></TABLE>
<TABLE align=center bgColor=#666666 border=0 cellPadding=2 cellSpacing=1
width=770>
<TBODY>
<TR>
<TD bgColor=#cccccc colSpan=3><SPAN style="COLOR: #cccccc"><IMG height=16
hspace=1 src="CSDN_文档中心_MFC编程中“占位符和动态创建”技巧的应用.files/ico_pencil.gif"
width=16> </SPAN> molight <I>(2001-1-31
9:15:38)</I> </TD></TR>
<TR>
<TD bgColor=#ffffff colSpan=3 width=532><BR>不错
<BR></TD></TR></TBODY></TABLE><BR>
<DIV align=center>
<TABLE align=center bgColor=#cccccc border=0 cellPadding=2 cellSpacing=1
width=770>
<TBODY>
<TR>
<TH bgColor=#006699 id=white><FONT
color=#ffffff>我要评论</FONT></TH></TR></TBODY></TABLE></DIV>
<DIV align=center>
<TABLE border=0 width=770>
<TBODY>
<TR>
<TD>你没有登陆,无法发表评论。 请先<A
href="http://www.csdn.net/member/login.asp?from=/Develop/read_article.asp?id=3007">登陆</A>
<A
href="http://www.csdn.net/expert/zc.asp">我要注册</A><BR></TD></TR></TBODY></TABLE></DIV><BR>
<HR noShade SIZE=1 width=770>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=500>
<TBODY>
<TR align=middle>
<TD height=10 vAlign=bottom><A
href="http://www.csdn.net/intro/intro.asp?id=2">网站简介</A> - <A
href="http://www.csdn.net/intro/intro.asp?id=5">广告服务</A> - <A
href="http://www.csdn.net/map/map.shtm">网站地图</A> - <A
href="http://www.csdn.net/help/help.asp">帮助信息</A> - <A
href="http://www.csdn.net/intro/intro.asp?id=2">联系方式</A> - <A
href="http://www.csdn.net/english">English</A> </TD>
<TD align=middle rowSpan=3><A
href="http://www.hd315.gov.cn/beian/view.asp?bianhao=010202001032100010"><IMG
border=0 height=48 src="CSDN_文档中心_MFC编程中“占位符和动态创建”技巧的应用.files/biaoshi.gif"
width=40></A></TD></TR>
<TR align=middle>
<TD vAlign=top>百联美达美公司 版权所有 京ICP证020026号</TD></TR>
<TR align=middle>
<TD vAlign=top><FONT face=Verdana>Copyright © CSDN.net, Inc. All rights
reserved</FONT></TD></TR>
<TR>
<TD height=15></TD>
<TD></TD></TR></TBODY></TABLE></DIV>
<DIV></DIV><!--内容结束//--><!--结束//--></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -