亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch24.htm

?? 一天之內學會VC#. 主要介紹VC#的各種應用和示例
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
function draws an ellipse inside the bounding rectangle. This is extremely usefulif you happen to be creating an ellipse control. However, because OleEdit must looklike an edit control, you must change the <TT>OnDraw</TT> function. The changes to<TT>OnDraw</TT> required for the OleEdit control are provided in Listing 24.1.<H4><FONT COLOR="#000077">TYPE: Listing 24.1. The OnDraw function used by COleEditCtrl.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>void COleEditCtrl::OnDraw(</TT><TT>     CDC* pdc, const CRect&amp; rcBounds, const CRect&amp; rcInvalid)</TT><TT>{</TT><TT>    COLORREF  clrBackground = TranslateColor(GetBackColor());</TT><TT>    CBrush*   pOldBrush;</TT><TT>    CBrush    brBackground( clrBackground );</TT><TT>    pdc-&gt;FillRect( rcBounds, &amp;brBackground );</TT><TT>    pOldBrush = pdc-&gt;SelectObject( &amp;brBackground );</TT><TT>    pdc-&gt;SelectObject( pOldBrush );</TT><TT>    DoSuperclassPaint(pdc, rcBounds);</TT><TT>    CRect rc(rcBounds);</TT><TT>    pdc-&gt;DrawEdge( rc, EDGE_SUNKEN, BF_RECT );</TT><TT>}</TT></FONT></PRE><P>The code provided in Listing 24.1 does three things. First, it fills the control'sbounding rectangle with the ambient background color. Next, it calls <TT>DoSuperclassPaint</TT>to give the edit control a chance to attempt to draw itself properly. Finally, itdraws a three-dimensional edge along the control's bounding rectangle.<H3><FONT COLOR="#000077"><B>Defining Properties for OleEdit</B></FONT></H3><P>OleEdit uses four properties: the <TT>Font</TT> and <TT>Text</TT> stock propertiesand the <TT>fTextAllowed</TT> and <TT>fNumbersAllowed</TT> custom properties. UsingClassWizard, add the stock properties for the OleEdit control. Select the Automationtab, and click the Add Property button. Fill in the dialog box using the values providedin Table 24.1.<H4><FONT COLOR="#000077">Table 24.1. Stock properties for the OleEdit control.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>External Name</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Implementation</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>Font</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Stock</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>Text</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Stock</TD>	</TR></TABLE></P><P>Use ClassWizard to add a custom property name <TT>fNumbersAllowed</TT> to theOleEdit project. Click the Add Property button and use the values provided in Table24.2.<H4><FONT COLOR="#000077">Table 24.2. The fNumbersAllowed custom property for theOleEdit control.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>Control</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Value</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">External name</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>fNumbersAllowed</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Type</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>BOOL</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Member variable name</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>m_fNumbersAllowed</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Notification function</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>OnFNumbersAllowedChanged</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Implementation</TD>		<TD ALIGN="LEFT" VALIGN="TOP">Member variable</TD>	</TR></TABLE></P><P>Use ClassWizard to add the <TT>fTextAllowed</TT> property, following the stepsused to add the previous properties. Use the values provided in Table 24.3.<H4><FONT COLOR="#000077">Table 24.3. The fTextAllowed custom property for the OleEditcontrol.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD HEIGHT="27" ALIGN="LEFT" VALIGN="TOP"><B>Control</B></TD>		<TD HEIGHT="27" ALIGN="LEFT" VALIGN="TOP"><B>Value</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">External name</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>fTextAllowed</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Type</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>BOOL</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Variable name</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>m_fTextAllowed</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Notification function</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>OnFTextAllowedChanged</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Implementation</TD>		<TD ALIGN="LEFT" VALIGN="TOP">Member variable</TD>	</TR></TABLE></P><P>Modify the <TT>COleEditCtrl</TT> class constructor to contain code that initializesthe custom properties added in the previous steps. The modified constructor is shownin Listing 24.2.<H4><FONT COLOR="#000077">TYPE: Listing 24.2. Modifications to the COleEditCtrl constructor.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>ColeEditCtrl::COleEditCtrl()</TT><TT>{</TT><TT>    InitializeIIDs(&amp;IID_DOleEdit, &amp;IID_DOleEditEvents);</TT><TT>    m_fTextAllowed = TRUE;</TT><TT>    m_fNumbersAllowed = TRUE;</TT><TT>}</TT></FONT></PRE><P>Every control created using ControlWizard includes a default property page. TheOleEdit property page is modified by adding two check boxes that control the statesof the <TT>m_fTextAllowed</TT> and <TT>m_fNumbersAllowed</TT> flags. Open the <TT>IDD_PROPPAGE_OLEEDIT</TT>dialog box resource and add two check box controls, as shown in Figure 24.4.</P><P><A NAME="04"></A><A HREF="04.htm"><B>Figure 24.4.</B></A> <I><BR>The property page used in OleEdit.</I></P><P>Table 24.4 lists the properties for the check box controls. All properties thataren't listed should be set to the default values.<H4><FONT COLOR="#000077">Table 24.4. Property values for check box controls in theOleEdit property page.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>Control</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Resource ID</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Caption</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Numbers check box</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_CHECK_NUMBERS</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>&amp;Numbers Allowed</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Text check box</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_CHECK_TEXT</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>&amp;Text Allowed</TT></TD>	</TR></TABLE></P><P>Use ClassWizard to associate <TT>COleEditPropPage</TT> member variables with thecontrols, using the values shown in Table 24.5.<H4><FONT COLOR="#000077">Table 24.5. Values for new member variables in COleEditPropPage.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>Control ID</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Variable Name</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Category</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Type</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Property Name</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_CHECK_NUMBERS</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>m_fNumbersAllowed</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Value</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>BOOL</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>fNumbersAllowed</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_CHECK_TEXT</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>m_fTextAllowed</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Value</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>BOOL</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>fTextAllowed</TT></TD>	</TR></TABLE></P><P>ClassWizard uses the optional Property Name field to generate source code thatexchanges the values from the property sheet to the control class. The <TT>DDP</TT>and <TT>DDX</TT> macros are used to transfer and validate property page data. Thecode used to transfer the value of the <TT>IDC_CHECK_TEXT</TT> control looks likethis:</P><PRE><FONT COLOR="#0066FF"><TT>//{{AFX_DATA_MAP(COleEditPropPage)</TT><TT>DDP_Check(pDX, IDC_CHECK_TEXT, m_fTextAllowed, _T(&quot;fTextAllowed&quot;));</TT><TT>DDX_Check(pDX, IDC_CHECK_TEXT, m_fTextAllowed;</TT><TT>//}}AFX_DATA_MAP</TT><TT>DDP_PostProcessing(pDX);</TT></FONT></PRE><P>Inside the control class, you must collect the values from the property page during<TT>DoPropExchange</TT>, as shown in Listing 24.3.<H4><FONT COLOR="#000077">TYPE: Listing 24.3. Collecting property page data duringDoPropExchange.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>void COleEditCtrl::DoPropExchange(CPropExchange* pPX)</TT><TT>{</TT><TT>    ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));</TT><TT>    COleControl::DoPropExchange(pPX);</TT><TT>    PX_Bool(pPX, _T(&quot;fNumbersAllowed&quot;), m_fNumbersAllowed );</TT><TT>    PX_Bool(pPX, _T(&quot;fTextAllowed&quot;), m_fTextAllowed );</TT><TT>}</TT></FONT></PRE><P>The OleEdit control supports the stock font property. An easy way to give thecontrol access to all the available fonts is to add the standard font property pageto the control. The property pages associated with an ActiveX control are groupedtogether between the <TT>BEGIN_PROPPAGEIDS</TT> and <TT>END_PROPPAGEIDS</TT> macrosin the control class implementation file.</P><P>Listing 24.4 shows how the standard font property page is added to the controlusing the <TT>PROPPAGEID</TT> macro. Remember to change the second parameter passedto the <TT>BEGIN_PROPPAGEIDS</TT> macro, the number of property pages used by thecontrol object. Locate the existing <TT>BEGIN_PROPPAGEIDS</TT> macro in the <TT>OleEditCtl.cpp</TT>file, and change that section of the file so that it looks like the code in Listing24.4.<H4><FONT COLOR="#000077">TYPE: Listing 24.4. Adding the standard font property pageto OleEdit.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>BEGIN_PROPPAGEIDS(COleEditCtrl, 2)      // changed</TT><TT>    PROPPAGEID(COleEditPropPage::guid)</TT><TT>    PROPPAGEID(CLSID_CFontPropPage)     // changed</TT><TT>END_PROPPAGEIDS(COleEditCtrl)</TT></FONT></PRE><P>As you will see when you test the control later in the hour, adding the font propertypage, along with exposing the stock font property, enables a user to easily changethe control font. The only code that is written to allow the user to change the control'sfont is in Listing 24.4.<H3><FONT COLOR="#000077"><B>Handling Character Input</B></FONT></H3><P>As discussed earlier, OleEdit uses exposed properties to determine whether charactersentered on the keyboard are stored in the edit control. If an invalid character isinput, an <TT>Error</TT> event is fired to the control's container. The message sentto the control as characters are input to the control is <TT>WM_CHAR</TT>. UsingClassWizard, add a message-handling function to the <TT>COleEditCtrl</TT> class,using the values from Table 24.6.<H4><FONT COLOR="#000077">Table 24.6. Handling the WM_CHAR message in COleEditCtrl.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>Class Name</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Object ID</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Message</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Function</B></TD>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美视频精品在线| 国产成人午夜电影网| 国产老妇另类xxxxx| 日本丰满少妇一区二区三区| 精品国产自在久精品国产| 中文字幕亚洲视频| 国产激情精品久久久第一区二区| 欧美性色综合网| 日韩伦理av电影| aaa欧美日韩| 亚洲国产成人在线| 国产91清纯白嫩初高中在线观看| 欧美群妇大交群的观看方式| 一区二区三区中文在线观看| 99精品国产视频| 一区二区中文视频| 国产精选一区二区三区| 国产精品乱码妇女bbbb| 亚洲电影一级黄| 美女一区二区视频| 久久老女人爱爱| 久久综合久久鬼色中文字| 国产一区91精品张津瑜| 制服丝袜亚洲精品中文字幕| 一区二区在线观看免费视频播放| 国产精一区二区三区| 欧美不卡一区二区三区| 手机精品视频在线观看| 欧美在线不卡视频| 亚洲欧美一区二区三区极速播放| 欧美一区二区三区在线视频 | 天天免费综合色| 欧美日韩精品一二三区| 日韩激情av在线| 精品久久一区二区三区| 国产成人精品影视| 亚洲视频网在线直播| 色综合久久综合| 三级欧美韩日大片在线看| 51精品秘密在线观看| 亚洲va天堂va国产va久| 欧美成人一区二区三区在线观看 | 欧美日韩一区二区三区不卡| 亚洲一区二区三区自拍| 制服丝袜av成人在线看| 精品一区二区三区久久| 国产精品福利影院| 欧美日韩久久久| 国产精品资源在线| 亚洲最快最全在线视频| 欧美大片免费久久精品三p| 成人福利视频网站| 亚洲成a人片在线观看中文| 国产精品久久久久久久岛一牛影视 | 美女视频网站久久| 欧美一级免费观看| 久久99精品国产91久久来源| 国产精品传媒视频| 久久影音资源网| 中文字幕在线不卡一区 | 极品销魂美女一区二区三区| 日韩欧美视频一区| 国产在线视频精品一区| 欧美激情一区二区三区蜜桃视频| 国产91丝袜在线播放九色| 国产精品丝袜黑色高跟| 色偷偷88欧美精品久久久| 欧美日韩在线精品一区二区三区激情| 麻豆精品久久精品色综合| 亚洲人成小说网站色在线 | 国产日韩欧美在线一区| 在线观看国产91| 成人丝袜视频网| 日精品一区二区三区| 一区二区国产盗摄色噜噜| 国产精品久久久爽爽爽麻豆色哟哟 | 欧美精品丝袜久久久中文字幕| 国产精品一区二区久久不卡| 亚洲国产欧美一区二区三区丁香婷| 日韩欧美国产一区在线观看| 在线观看成人小视频| 99re亚洲国产精品| av欧美精品.com| 色视频成人在线观看免| 99久久久精品| 91免费精品国自产拍在线不卡| 国产成人午夜精品影院观看视频 | 欧美a级一区二区| 视频在线观看一区二区三区| 亚洲欧洲精品天堂一级| 欧美日韩综合一区| 91精品国产91综合久久蜜臀| 亚洲综合男人的天堂| 色综合天天视频在线观看 | 国产原创一区二区| 亚洲色图色小说| 91精品麻豆日日躁夜夜躁| 国产成人日日夜夜| 亚洲午夜在线电影| 精品对白一区国产伦| 色综合久久久久| 国产在线播放一区| 亚洲成人免费观看| 国产精品免费人成网站| 日韩三级精品电影久久久 | 狠狠色伊人亚洲综合成人| 亚洲日本护士毛茸茸| 欧美一区二区三区四区视频| 不卡欧美aaaaa| 久久国产精品露脸对白| 一区二区三区av电影| 国产欧美综合在线| 91精品国产色综合久久| 91亚洲永久精品| 国产一区二区精品久久| 亚州成人在线电影| 国产精品理论在线观看| 精品国产一区二区三区不卡| 91国模大尺度私拍在线视频| 国产精品一区免费视频| 婷婷综合久久一区二区三区| 国产精品久久夜| 久久众筹精品私拍模特| 欧美精品三级日韩久久| 91在线看国产| 国产不卡在线一区| 久久av老司机精品网站导航| 亚洲国产成人高清精品| 国产精品国产三级国产专播品爱网| 欧美成人一区二区三区在线观看| 欧美午夜精品一区二区蜜桃| av一区二区三区黑人| 国产99精品在线观看| 久国产精品韩国三级视频| 午夜激情综合网| 亚洲一级电影视频| 亚洲毛片av在线| 国产精品免费视频观看| 国产日本一区二区| 久久午夜色播影院免费高清| 欧美一级搡bbbb搡bbbb| 欧美巨大另类极品videosbest | 日韩亚洲欧美成人一区| 欧美又粗又大又爽| 93久久精品日日躁夜夜躁欧美| 国产福利一区二区三区在线视频| 美女尤物国产一区| 男人的天堂亚洲一区| 日韩精品国产欧美| 亚洲成人三级小说| 香蕉成人啪国产精品视频综合网| 亚洲精品久久嫩草网站秘色| 中文字幕一区二区三区不卡| 国产精品久久久久久久久果冻传媒| 国产三级欧美三级| 日本一区二区三区四区| 国产亚洲一区二区三区在线观看| 久久影视一区二区| 久久精品一级爱片| 中文字幕欧美激情| 欧美国产成人在线| 中文字幕在线不卡| 亚洲蜜臀av乱码久久精品蜜桃| 中文字幕一区二| 一区二区三区四区av| 亚洲一区二区在线免费看| 亚洲国产一区二区视频| 五月婷婷综合在线| 日韩1区2区日韩1区2区| 免费在线观看一区| 黄一区二区三区| 国产91精品精华液一区二区三区| 丁香婷婷综合网| 91啪九色porn原创视频在线观看| 97久久精品人人澡人人爽| 在线精品视频免费播放| 欧美日韩成人一区二区| 欧美高清视频一二三区 | 91精品国产色综合久久不卡蜜臀| 欧美精品久久久久久久多人混战 | 欧美成人a在线| 久久美女高清视频| 中文字幕一区二区三区四区| 亚洲欧洲韩国日本视频| 亚洲成av人片一区二区梦乃| 日本aⅴ免费视频一区二区三区| 久久国产精品99久久久久久老狼| 蜜桃av一区二区在线观看 | 国产精品一区二区久久精品爱涩 | 婷婷开心久久网| 中文字幕亚洲在| 国产日韩亚洲欧美综合| 99国产精品久久| 欧美在线啊v一区| 日韩精品一区二区三区蜜臀| 国产免费观看久久| 一区二区欧美视频| 黑人精品欧美一区二区蜜桃| 成人高清视频在线| 欧美精品少妇一区二区三区|