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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? ch14.htm

?? 一天之內(nèi)學(xué)會(huì)VC#. 主要介紹VC#的各種應(yīng)用和示例
?? HTM
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD>		<TITLE>Teach Yourself Visual C++&#174; 5 in 24 Hours -- Hour 14 -- Icons and Cursors</TITLE></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF"><CENTER><H1><IMG SRC="../button/sams.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"><BR><FONT COLOR="#000077">Teach Yourself Visual C++&#174; 5 in 24 Hours</FONT></H1></CENTER><CENTER><P><A HREF="../ch13/ch13.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch15/ch15.htm"><IMGSRC="../button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../button/contents.gif" WIDTH="128"HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> <HR></CENTER><CENTER><H1><FONT COLOR="#000077">- Hour 14 -<BR>Icons and Cursors</FONT></H1></CENTER><P>Icons and cursors are two commonly used GDI objects. In this hour, you will learnhow to<UL>	<LI>Use icons in your MFC program<BR>	<BR>		<LI>Add icons to button controls<BR>	<BR>		<LI>Manage cursors in your MFC program</UL><P>There are several examples in this hour; you will add icons to pushbutton controls,clip cursors to a specific rectangle, and change the cursor to an hourglass to indicatethat a long process is in progress.<H2><FONT COLOR="#000077"><B>What Is an Icon?</B></FONT></H2><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>An <I>icon</I> is a smallbitmap that represents another object in a Windows program.</P><P>Icons are used to represent minimized child windows in an MDI application. Iconsalso are widely used by Windows itself. When a program is minimized, its icon isdisplayed in the Windows 95 taskbar. When you're using the Explorer, the icon representingan application associated with each file is displayed next to the file's name. Windowsdisplays the program's icon in the upper-left corner of the main window title bar.</P><P>The Windows 95 Explorer uses the icon resources associated with your program whendetermining which icons to display. If large and small icons are available, the Exploreruses the icon resources from your application's EXE file. However, if you provideonly a large icon, the Explorer synthesizes a small icon, which usually results ina small, distorted icon.<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Just a Minute:</B></FONT><B> </B>Icons also are	used in dialog boxes. For example, the message dialog boxes discussed in Hour 4,	&quot;Dialog Boxes and C++ Classes,&quot; use icons to indicate the type of message	conveyed. It's also common practice to include an application's icon in the About	dialog box. <HR></BLOCKQUOTE><P>There are several different types of icon resources. In Hour 18, &quot;List ViewControls,&quot; you will use large and small icons in a list view control. Four differenttypes of icons are available:<UL>	<LI>Large icons: Used for most programs written for Windows before the release of	Windows 95, these icons are 32x32 pixels and support 16 colors.<BR>	<BR>		<LI>Small icons: First introduced with Windows 95, these icons are usually a smaller	(16x16 pixels) version of a program's large icon.<BR>	<BR>		<LI>256-color icons: These icons support more than the standard 16 colors available	to other types of icons. These icons are 48x48 pixels, and are never displayed as	a program's icon when the window is minimized.<BR>	<BR>		<LI>Monochrome icons: These icons support only two colors and are 32x32 pixels large.</UL><P>Icons are similar to bitmaps, which are covered in Hour 15, &quot;Using Bitmaps.&quot;However, the code required to use an icon is so simple that there's not even an MFCclass named <TT>CIcon</TT> dedicated to making using icons easier. Instead, you manipulatean <TT>HICON</TT>, or handle to an icon, directly.<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Time Saver:</B></FONT><B> </B>An image list is ideal	for collecting icon images. Any image stored in an image list can be converted into	an icon using the <TT>ExtractIcon</TT> member function. Image lists are covered in	Hour 17, &quot;Using Image Lists and Bitmaps.&quot; <HR></BLOCKQUOTE><H2><FONT COLOR="#000077"><B>Creating Icons Using the Image Editor</B></FONT></H2><BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Just a Minute:</B></FONT><B> </B>Because icons are	resources, you add them to a program's resource file just as you do bitmaps, menus,	and dialog boxes. You create new icons using the resource editor. <HR></BLOCKQUOTE><P>When creating a new project, AppWizard creates a set of default icons for yourproject automatically. You can use the Developer Studio image editor to edit or createnew icons for your project.</P><P>To open the image editor, open the ResourceView in the project workspace and thenopen the Icon folder. Double-click any icon resource contained in the folder to openthe editor. In an MDI application created by AppWizard, two icon resources will bedefined for a new project:<UL>	<LI><TT>IDR_MAINFRAME</TT>: An icon that is associated with the application; this	is the MFC cube icon by default.<BR>	<BR>		<LI><TT>IDR_MYAPPTYPE</TT>: Where MyApp is the name of the project. This icon is	used to represent the MDI child window. By default, this icon is the standard MFC	Doc icon.</UL><P>You can change these icon resources to represent the application with which youare working.</P><P>The color palette is displayed whenever you are editing an image resource. Thecolor palette consists of several colored boxes. To change the color of the currentdrawing tool, click the color you want. There are two special color icons in thecolor palette:<UL>	<LI>The <I>transparent</I> color: The background shows through the icon<BR>	<BR>		<LI>The <I>reverse video</I> color: The background shows through after reversing	the video</UL><P>You can find the transparent and reverse video colors on the upper-right cornerof the color palette. Switch to the transparent color by clicking the small videodisplay icon with a green screen, and switch to the reverse video color by clickingthe small video display with the red screen.<H3><FONT COLOR="#000077"><B>Inserting a New Icon Resource</B></FONT></H3><P>To insert a new icon resource into an existing project, right-click the Icon folderin the resource view, and select Insert Icon from the pop-up menu; this opens theimage editor with a blank icon, ready for editing. You can change attributes foricon resources, as with all resources, by double-clicking the edge of the icon resourceor by pressing Alt+Enter on the keyboard.<H3><FONT COLOR="#000077"><B>Loading an Icon</B></FONT></H3><P>After you have added an icon to a project, loading and displaying it requiresthree lines of code. To load an icon and prepare it for display, use the <TT>LoadIcon</TT>function:</P><PRE><FONT COLOR="#0066FF"><TT>HICON hIcon = AfxGetApp()-&gt;LoadIcon( IDI_LOGO );</TT></FONT></PRE><P>Because <TT>LoadIcon</TT> is a <TT>CWinApp</TT> member function, a pointer tothe application's <TT>CWinApp</TT> object must be fetched using the <TT>AfxGetApp</TT>function.</P><P>After the icon has been loaded, display it by calling <TT>DrawIcon</TT>:</P><PRE><FONT COLOR="#0066FF"><TT>pDC-&gt;DrawIcon( 0,0, hIcon );</TT></FONT></PRE><P>The <TT>DrawIcon</TT> function is a member of the <TT>CDC</TT> class. The coordinatesand icon handle must be passed as parameters.</P><P>After using <TT>LoadIcon</TT>, release the icon resource by calling the <TT>DestroyIcon</TT>function:</P><PRE><FONT COLOR="#0066FF"><TT>DestroyIcon( hIcon );</TT></FONT></PRE><BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>CAUTION:</B></FONT><B> </B>If you forget to call	<TT>DestroyIcon</TT>, the memory allocated for the icon isn't released. <HR></BLOCKQUOTE><H3><FONT COLOR="#000077"><B>Changing a Program's Icon</B></FONT></H3><P>The icon used for a program is created by AppWizard when you initially createthe project. To change this icon, open the image editor by double-clicking the application'sicon in the resource view Icon folder.</P><P>After opening the icon, use the image editor tools to modify the icon as you want.Every application written for Windows can have its icon displayed in large and smallformats. If you edit one of the icon formats, make sure you make corresponding changesin all formats supported by the icon. To display and edit all the available formats,click the drop-down combo box above the image editor, which displays all the supportedformats for the icon. Selecting a new format loads that version of the icon intothe image editor.</P><P>Every child window type also has a unique icon. You can edit that icon just asyou do the program's main icon. As discussed earlier this hour, the child windowicon is named with a shared resource identifier in the form <TT>IDR_MYAPPTYPE</TT>,where the application is named <TT>MyApp</TT>.<H3><FONT COLOR="#000077"><B>Retrieving Icons from Image Lists</B></FONT></H3><P>When an image is stored in an image list, the image list often draws the itemdirectly, using the MFC <TT>CImageList::Draw</TT> member function. However, you alsocan have the image list create an icon based on an individual image. The <TT>CImageList::ExtractIcon</TT>member function is used to create such an icon:</P><PRE><FONT COLOR="#0066FF"><TT>HICON hIcon = m_imageList.ExtractIcon( 2 );</TT></FONT></PRE><P>Using this member function is useful when several icons must be stored together.<H3><FONT COLOR="#000077"><B>Displaying an Icon on a Button</B></FONT></H3><P>Another useful way to use an icon is to display it in a button. Beginning withWindows 95, it's possible to display an icon in a button almost as easily as displayinga text string. Use the <TT>CButton</TT> member function <TT>SetIcon</TT> to set abutton's icon. The icon must be loaded before it is used and destroyed after thebutton is destroyed.<H4><FONT COLOR="#000077">Adding New Icon Resources</FONT></H4><P>For this example, add two buttons to the DCTest About dialog box. These two &quot;stop-light&quot;buttons work just like the traditional OK and Cancel buttons. Figure 14.1 shows the<TT>IDI_RED</TT> icon; although you can't tell from the figure, this icon consistsof a red circle surrounded by the transparent color. Also, create a similar iconnamed <TT>IDI_GREEN</TT>, using a green circle surrounded by the transparent color.</P><P><A NAME="01"></A><A HREF="01.htm"><B>Figure 14.1.</B> </A><BR><I>The new icons used in the DCTest example.</I></P><P>Use the two icons created earlier to label buttons in the DCTest About dialogbox. Modify the <TT>IDD_ABOUT</TT> dialog box by adding an extra button to it, asshown in Figure 14.2.</P><P><A NAME="02"></A><A HREF="02.htm"><B>Figure 14.2.</B> </A><I><BR>The About dialog box used in the Icon example.</I></P><P>Use the values from Table 14.1 to set the attributes for the two buttons in theAbout dialog box. Use ClassWizard to add the two buttons to the <TT>CAboutDlg</TT>class as <TT>CButton</TT> variables.<H4><FONT COLOR="#000077">Table 14.1. Values used for button controls in the DCTestAbout dialog box.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>ID</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Variable Name</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Control Type</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Attributes</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDOK</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>m_btnOkay</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">CButton</TD>		<TD ALIGN="LEFT" VALIGN="TOP">Visible, Tabstop, Icon, Default</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDCANCEL</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>m_btnCancel</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">CButton</TD>		<TD ALIGN="LEFT" VALIGN="TOP">Visible, Tabstop, Icon</TD>	</TR></TABLE></P><P>Buttons that have icon labels instead of text must have the Icon attribute set.Review each button's Properties dialog box under the Styles tab and make sure theIcon option is checked.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产专区欧美精品| 成人免费视频视频| 国产精品女主播av| 欧美日韩免费视频| 国产成人精品三级麻豆| 五月天中文字幕一区二区| 中文字幕av一区二区三区免费看| 欧美美女直播网站| 91热门视频在线观看| 国模大尺度一区二区三区| 亚洲成人av中文| 亚洲少妇最新在线视频| 精品国产一区久久| 欧美视频一区二区三区| 久久丝袜美腿综合| 欧美久久婷婷综合色| 99久久99久久久精品齐齐| 国产毛片精品视频| 久久成人免费网站| 日韩1区2区日韩1区2区| 亚洲h在线观看| 一区二区三区中文字幕精品精品| 中文字幕第一区| 国产视频视频一区| 26uuu国产在线精品一区二区| 欧美精品三级在线观看| 欧美性xxxxxx少妇| 欧美在线观看视频一区二区| 91免费精品国自产拍在线不卡| 国产69精品久久久久777| 久久精工是国产品牌吗| 蜜臀av在线播放一区二区三区| 无吗不卡中文字幕| 亚洲aⅴ怡春院| 一二三四社区欧美黄| 亚洲黄色小视频| 亚洲精选免费视频| 亚洲欧美在线aaa| 国产精品精品国产色婷婷| 国产欧美综合色| 国产三级精品在线| 国产精品欧美久久久久一区二区| 久久亚洲影视婷婷| 国产午夜亚洲精品不卡| 中文字幕av一区二区三区高| 欧美激情在线一区二区| 国产精品久久久久久久裸模| 国产精品丝袜黑色高跟| 中文一区一区三区高中清不卡| 国产三级一区二区| 久久精品国产99国产精品| 日韩avvvv在线播放| 奇米精品一区二区三区四区| 免费在线观看视频一区| 久久91精品国产91久久小草| 国产精品一区二区在线观看不卡 | 精品一区二区三区av| 久久精品国产999大香线蕉| 韩国中文字幕2020精品| 成人av影院在线| 在线免费视频一区二区| 69堂精品视频| 欧美精品一区二区三区高清aⅴ| 国产亚洲成av人在线观看导航 | 国产精品久久久久久久久搜平片| 中日韩免费视频中文字幕| 亚洲啪啪综合av一区二区三区| 亚洲综合激情网| 蜜桃在线一区二区三区| 懂色av中文字幕一区二区三区| 国产精品美女久久久久久| 亚洲欧美激情一区二区| 人妖欧美一区二区| 国产白丝网站精品污在线入口| 91香蕉国产在线观看软件| 欧美精品高清视频| 国产欧美va欧美不卡在线| 夜夜嗨av一区二区三区四季av| 免费一级欧美片在线观看| 国产ts人妖一区二区| 欧美日韩在线亚洲一区蜜芽| 精品乱人伦小说| 亚洲免费在线看| 捆绑变态av一区二区三区| 99精品视频在线观看免费| 91精品福利在线一区二区三区| 国产欧美日韩亚州综合 | 日本va欧美va瓶| 成年人国产精品| 337p亚洲精品色噜噜噜| 国产精品毛片a∨一区二区三区| 亚洲h精品动漫在线观看| 懂色中文一区二区在线播放| 欧美日韩黄视频| 国产精品久久久久久久久免费桃花 | 欧美一区二区啪啪| 综合中文字幕亚洲| 久久99国产精品久久99| 在线视频综合导航| 国产欧美精品区一区二区三区| 午夜精品久久久久久久久久久| 成人小视频免费观看| 亚洲在线视频网站| 国产成人在线观看| 欧美一区二区成人| 亚洲综合色在线| 波多野结衣中文一区| 精品美女在线观看| 五月激情综合婷婷| 91福利国产成人精品照片| 亚洲国产精品激情在线观看 | 日本美女一区二区三区视频| 99麻豆久久久国产精品免费优播| 久久亚洲影视婷婷| 蜜臀久久99精品久久久久久9| 欧美网站一区二区| 亚洲视频在线观看三级| 成人av影视在线观看| 久久精品亚洲精品国产欧美| 久国产精品韩国三级视频| 91麻豆精品国产91久久久久久久久| 亚洲激情在线播放| 91丨九色丨国产丨porny| 中文字幕在线不卡一区| 国产成人丝袜美腿| 精品国产乱码久久久久久久| 日韩专区欧美专区| 欧美人与性动xxxx| 香蕉影视欧美成人| 欧美美女网站色| 午夜欧美视频在线观看 | 国产人妖乱国产精品人妖| 久久国产三级精品| 日韩欧美专区在线| 老司机精品视频在线| 日韩欧美中文字幕精品| 麻豆精品视频在线观看| 日韩美一区二区三区| 久久精品99国产精品| 26uuu久久天堂性欧美| 国产自产v一区二区三区c| 久久久精品免费观看| 国产一区二区在线看| 国产亚洲欧美激情| 大尺度一区二区| 日韩一区有码在线| 日本电影欧美片| 午夜成人在线视频| 日韩一级片网站| 国产中文一区二区三区| 国产清纯在线一区二区www| 成人激情黄色小说| 一区二区三区欧美久久| 欧美日韩高清影院| 精品一区二区三区视频| 久久久精品黄色| eeuss鲁片一区二区三区| 一区二区三区日韩精品| 欧美一区二区视频观看视频| 国产尤物一区二区| 成人免费视频在线观看| 欧美日本在线视频| 国产乱一区二区| 亚洲免费视频中文字幕| 91麻豆精品国产无毒不卡在线观看| 国产在线视频一区二区三区| 中文字幕一区二区三区在线播放| 在线影院国内精品| 麻豆精品一区二区| 中文字幕av一区二区三区高| 欧美三级资源在线| 国产在线精品免费| 最新中文字幕一区二区三区| 欧美一区二区三区四区五区| 成人午夜视频福利| 亚洲无人区一区| 国产亚洲欧美日韩日本| 欧美性高清videossexo| 国产乱码精品一区二区三| 亚洲欧美日本韩国| 欧美mv日韩mv国产网站app| 99久久精品国产毛片| 日本最新不卡在线| 亚洲欧洲日韩在线| 日韩欧美在线综合网| 91视频精品在这里| 蜜臀久久99精品久久久画质超高清| 国产精品久久毛片| 欧美成人精品3d动漫h| bt7086福利一区国产| 强制捆绑调教一区二区| 亚洲欧洲精品一区二区三区不卡| 欧美一级欧美一级在线播放| aaa国产一区| 国内不卡的二区三区中文字幕| 一区二区三区国产精品| 国产亚洲一二三区| 7777精品伊人久久久大香线蕉 | 91麻豆国产福利在线观看| 亚洲成人激情av|