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

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

?? ch10.htm

?? 一天之內學會VC#. 主要介紹VC#的各種應用和示例
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD>		<TITLE>Teach Yourself Visual C++&#174; 5 in 24 Hours -- Hour 10 -- Menus</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="../ch09/ch09.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch11/ch11.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 10 -<BR>Menus</FONT></H1></CENTER><P>Menus are an essential part of most Windows programs. With the exception of somesimple dialog box-based applications, all Windows programs offer some type of menu.</P><P>In this hour, you will learn<UL>	<LI>How menus are used in Windows programs<BR>	<BR>		<LI>How the MFC <TT>CMenu</TT> class is used to support menus<BR>	<BR>		<LI>How to add accelerators to your menu items</UL><P>In this hour you will also modify a menu created by AppWizard and create a floatingcontext menu.<H2><FONT COLOR="#000077"><B>What Is a Menu?</B></FONT></H2><P>A <I>menu</I> is a list of command messages that can be selected and sent to awindow.</P><P>To the user, a menu item is a string that indicates a task that can be performedby the application. Each menu item also has an ID that is used to identify the itemwhen routing window messages. This ID is also used when modifying attributes forthe menu item.</P><P>Menus are usually attached to a window, although many applications support floatingpop-up menus that can appear anywhere on the desktop. Later in this hour, you createa floating pop-up menu that is displayed when the right mouse button is pressed.These menus are often used to provide context-sensitive help and offer differentmenu choices depending on the window that creates the menu.</P><P>In order to make Windows programs easier to use, most programs follow a commonset of guidelines regarding the appearance of their menus. For example, menu itemsleading to dialog boxes that require additional user input are usually marked withan ellipsis (...).</P><P>Another user interface requirement is a mnemonic, or underlined letter for eachmenu item. When this letter is pressed, the appropriate menu item is selected. Thisletter is usually the first letter of the menu item; however, in some cases anotherletter is used. For example, the Exit menu item found in the File menu uses X asits mnemonic. You must be careful not to duplicate letters used for mnemonics; ifyou do, the menu won't work properly.</P><P>Menus are sometimes <I>nested</I>, which means that one menu item is actuallya submenu with a series of additional menu items. A menu item that leads to a nestedsubmenu has a right arrow to indicate that more selections are available. You cansee an example of a nested menu structure in the menus used by the Windows 95 Startbutton, as shown in Figure 10.1.</P><P><A NAME="01"></A><A HREF="01.htm"><B>Figure 10.1.</B></A> <BR><I>The nested menu structure used by the Start button.</I><H3><FONT COLOR="#000077"><B>Command Message Routing</B></FONT></H3><P>Before you learn about creating and modifying menus, look at how menu messagesare handled by Windows programs in general and MFC programs in particular.</P><P>A menu is always associated with a particular window. In most MFC programs, itis associated with the main frame window, which also contains the application's toolbarand status bar. When a menu item is selected, a <TT>WM_COMMAND</TT> message is sentto the main frame window; this message includes the ID of the menu item. The MFCframework and your application convert this message into a function call, as describedin Hour 8, &quot;Messages and Event-Driven Programming.&quot;</P><P>In an MFC application, many windows can receive a menu selection message. In general,any window that is derived from the <TT>CCmdTarget</TT> class is plugged into theMFC framework's message loop. When a menu item is selected, the message is offeredto all the command target objects in your application, in the following order:<DL>	<DD>1. The <TT>CMainFrame</TT> object<BR>	<BR>	2. The main MDI frame window<BR>	<BR>	3. The active child frame of an MDI frame window<BR>	<BR>	4. The view that is associated with the MDI child frame<BR>	<BR>	5. The document object associated with the active view<BR>	<BR>	6. The document template associated with the document object<BR>	<BR>	7. The <TT>CWinApp</TT> object</DL><BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Just a Minute:</B></FONT><B> </B>This list might	seem like a large number of steps to take, but it's actually not very complicated	in practice. Usually, a menu item is handled by one type of object: a view or main	frame. Menu messages are rarely handled directly by the document template or child	frame objects. <HR></BLOCKQUOTE><P>Figure 10.2 shows a simplified map of how commands are routed in an MFC application.</P><P>In most cases, you can use ClassWizard to configure the message maps requiredto route menu selection messages to their proper destinations.<H3><FONT COLOR="#000077"><B>MFC Support for Menus</B></FONT></H3><P>You can create menus dynamically or as static resources that are added to yourprogram. The MFC class library provides a <TT>CMenu</TT> class that simplifies handlingmenus and is used for the examples in this hour.</P><P><A NAME="02"></A><A HREF="02.htm"><B>Figure 10.2.</B></A> <I><BR>Menu command routing in an MFC application.</I></P><P>AppWizard generates a menu resource for programs that it creates. This menu resourcecan be edited to add extra menu items for your application, or you can create newmenu resources for your application.</P><P>For the examples used in this hour, create a sample SDI application called Menu.This program is used to demonstrate how menu resources are created and modified.<H2><FONT COLOR="#000077"><B>Adding New Menu Items</B></FONT></H2><P>One of the easiest tasks to perform with a menu is adding a new menu item. Inorder to use a new menu item, you must do two things:<UL>	<LI>Modify the menu resource to include the new menu item.	<LI>Add a message-handling function using ClassWizard.</UL><P>These steps are explained in the next two sections.<H3><FONT COLOR="#000077"><B>Opening the Menu Resource</B></FONT></H3><P>To display the current menu resources, select the ResourceView tab in the projectworkspace window. Expand the resource tree to show the different resource types definedfor the current project; one of the folders is labeled Menu.</P><P>Open the Menu folder to display the resources defined for the project's menus.Every multiple-document application created by AppWizard has two menu resources.MDI applications use an <TT>IDR_MAINFRAME</TT> menu when no views are active. Theyalso have an additional menu item used when a view is active. The name of this menuresource is based on the application name, such as <TT>IDR_<I>xxx</I>TYPE</TT>, where<I><TT>xxx</TT></I> is replaced by the program's name. For example, <TT>IDR_FOOTYPE</TT>is the second menu resource created for a program named Foo.</P><P>SDI applications, such as the Menu example, have a single menu created by AppWizardnamed <TT>IDR_MAINFRAME</TT>. This is the menu displayed by default for single-documentapplications. Every AppWizard program begins with the same menu; supplying any modificationsthat are required for your application is up to you.<H3><FONT COLOR="#000077"><B>Editing the Menu Resource</B></FONT></H3><P>Open the menu resource by double-clicking the menu resource icon. The menu isdisplayed in the resource editor ready for editing. When the menu is initially loadedinto the editor, only the top-level menu bar is displayed. Clicking any top-levelmenu item displays the pop-up menu associated with that item, as shown in Figure10.3.</P><P><A NAME="03"></A><A HREF="03.htm"><B>Figure 10.3.</B></A> <I><BR>Using the Developer Studio resource editor to edit a menu resource.</I></P><P>The last item of every menu is an empty box. This box is used to add new menuitems to the menu resource. All menu items are initially added to the end of a menuresource and then moved to their proper position. To add a new menu item, followthese steps:<DL>	<DD>1. Double-click the empty box on the File menu to display the Menu Properties	dialog box.<BR>	<BR>	2. To add a menu item, provide a menu ID and caption for the new menu item. By convention,	menu IDs begin with <TT>ID_</TT> and then you include the name of the top-level menu.	For this example, enter <TT>ID_FILE_HELLO</TT> as the menu ID and &amp;Hello as the	menu caption.<BR>	<BR>	3. Optionally, you can provide a prompt that is displayed in the status bar when	the new menu item is highlighted.<BR>	<BR>	4. Click anywhere outside the Properties dialog box to return to the editor.</DL><P>After you've added the new menu item you can move it to a new position by draggingit with the mouse. Changing the menu position does not change any of its attributes.<H3><FONT COLOR="#000077"><B>Menu Item Properties</B></FONT></H3><P>Several optional properties can be applied to a menu item via the Properties dialogbox:<UL>	<LI><I>ID</I> is used for the menu's resource ID. This ID is sent as part of the	<TT>WM_COMMAND</TT> message to your application and is used by ClassWizard to identify	the menu item.<BR>	<BR>		<LI><I>Caption</I> is the name used to identify the menu item. The mnemonic letter	is preceded by an ampersand (<TT>&amp;</TT>) and is used to select the item without	using the mouse.<BR>	<BR>		<LI><I>Separator</I> is used to indicate that this menu item is a separator, or horizontal	line that divides logical sections of a menu. This check box is usually cleared.<BR>	<BR>		<LI><I>Checked</I> is used to indicate that the menu item should display a check	mark to indicate the menu item is selected. This check box is usually cleared.<BR>	<BR>		<LI><I>Pop-up</I> is used to indicate that this menu item is the top level of a pop-up	or submenu. This option is usually cleared except on the top-level menu bar.<BR>	<BR>		<LI><I>Grayed</I> indicates that this menu item is grayed. This check box is usually	cleared.<BR>	<BR>		<LI><I>Inactive</I> indicates that this menu item is inactive. This check box is	usually cleared.<BR>	<BR>		<LI><I>Help</I> places the menu item to the far right side of the menu bar. This	option is rarely used, even for the Help menu.<BR>	<BR>		<LI><I>Break</I> is used to split the menu at this menu item. The default choice	is none and is used in almost all cases.<BR>	<BR>		<LI><I>Prompt</I> is used to specify the text that will be displayed in the status

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久永久免费观看| 久久女同性恋中文字幕| 精品少妇一区二区三区在线播放 | 亚洲人成7777| 麻豆视频一区二区| 色av一区二区| 国产日韩欧美精品电影三级在线| 欧美放荡的少妇| 亚洲嫩草精品久久| 国产成人免费xxxxxxxx| 91精品福利在线一区二区三区 | eeuss影院一区二区三区| 91麻豆精品国产自产在线 | 欧美色综合影院| 国产精品福利一区| 国产精品一区二区三区99| 欧美一区二区在线视频| 亚洲一区二区三区激情| 色综合视频一区二区三区高清| 日韩视频免费观看高清完整版在线观看 | 成人免费视频caoporn| 欧美不卡视频一区| 日韩在线观看一区二区| 欧美午夜精品免费| 一区二区在线观看视频| 色综合天天在线| 一区在线观看视频| 91亚洲永久精品| 亚洲日本va午夜在线影院| 国产成人精品免费| 欧美激情一区二区三区四区| 国产老肥熟一区二区三区| 欧美一二区视频| 国产一区啦啦啦在线观看| 欧美成人乱码一区二区三区| 秋霞电影网一区二区| 欧美一区二区三区白人| 秋霞成人午夜伦在线观看| 欧美xxxxx牲另类人与| 久久99精品视频| 国产丝袜欧美中文另类| 成人动漫在线一区| 亚洲色图视频网站| 欧美日韩日日夜夜| 日本欧美一区二区三区乱码| 日韩无一区二区| 国产精品一区二区果冻传媒| 国产欧美一区视频| 色琪琪一区二区三区亚洲区| 亚洲444eee在线观看| 欧美www视频| 国产盗摄视频一区二区三区| 亚洲视频精选在线| 欧美人与性动xxxx| 韩国女主播一区| 国产精品你懂的在线| 色爱区综合激月婷婷| 男女性色大片免费观看一区二区| 精品精品国产高清a毛片牛牛| 国产一区二区三区电影在线观看| 国产精品欧美极品| 欧美精品v国产精品v日韩精品| 精品午夜一区二区三区在线观看| 国产情人综合久久777777| 91搞黄在线观看| 狠狠色综合日日| 一区二区三区加勒比av| 精品av久久707| 色94色欧美sute亚洲13| 久久精品国产精品亚洲红杏| 国产精品久久久久久久久动漫 | 国产精品福利影院| 欧美一区二区三区在| 成人免费精品视频| 日本在线不卡一区| 一区二区中文视频| 精品美女一区二区| 欧美色综合影院| a级高清视频欧美日韩| 久久精品999| 亚洲国产精品视频| 国产精品免费av| 欧美成人bangbros| 欧美视频一区二区三区在线观看| 高清国产午夜精品久久久久久| 五月综合激情婷婷六月色窝| 中文字幕日韩一区| 久久久久久久久久久99999| 91精品国模一区二区三区| av在线这里只有精品| 激情小说欧美图片| 热久久免费视频| 亚洲午夜精品网| 亚洲美女精品一区| 国产精品污www在线观看| 精品久久一区二区三区| 51精品国自产在线| 欧美性猛交xxxx乱大交退制版| 成人在线视频一区| 国产成人在线观看免费网站| 男女男精品网站| 免费成人深夜小野草| 天天射综合影视| 亚洲动漫第一页| 亚洲国产精品久久一线不卡| 成人免费一区二区三区视频| 国产精品色哟哟| 国产精品你懂的在线| 中文字幕第一页久久| 久久久91精品国产一区二区三区| 欧美大片一区二区三区| 欧美一区二区三区在线观看| 717成人午夜免费福利电影| 欧美日韩第一区日日骚| 欧美男人的天堂一二区| 88在线观看91蜜桃国自产| 91精品国产一区二区三区蜜臀| 69久久99精品久久久久婷婷| www.欧美色图| 91女神在线视频| 色婷婷久久久综合中文字幕| 91精品福利视频| 欧美挠脚心视频网站| 日韩欧美一区二区视频| 欧美不卡在线视频| 国产午夜精品美女毛片视频| 国产精品水嫩水嫩| 亚洲精品中文在线| 亚洲成av人片| 精品在线观看视频| 国产成人免费在线观看不卡| 成人av电影在线| 欧美在线你懂的| 欧美一区二区三区免费在线看| 精品免费日韩av| 成人欧美一区二区三区在线播放| 亚洲午夜久久久久| 久久成人免费网| av在线一区二区| 91麻豆精品国产91久久久久| 久久久精品国产99久久精品芒果| 亚洲欧美在线另类| 日韩国产高清在线| 成人午夜伦理影院| 欧美久久久久久久久中文字幕| 精品国产99国产精品| 亚洲天堂福利av| 美国十次综合导航| 99精品欧美一区二区蜜桃免费| 欧美日韩高清一区二区不卡| 久久综合av免费| 亚洲愉拍自拍另类高清精品| 久久99国产精品久久99果冻传媒| av电影天堂一区二区在线观看| 制服丝袜中文字幕一区| 国产精品久久久久久久久晋中| 日韩在线一区二区| 91麻豆国产精品久久| 精品国产乱码久久久久久1区2区| 日韩一区在线看| 国产一区二区三区四区五区美女| 在线一区二区三区四区五区| 久久免费电影网| 婷婷综合久久一区二区三区| 不卡一区中文字幕| 精品国产麻豆免费人成网站| 亚洲一区视频在线| 成人激情免费网站| 日韩一区二区三区视频在线| 亚洲毛片av在线| 成人动漫一区二区| 精品av久久707| 美女一区二区视频| 欧美日韩一区成人| 亚洲美女淫视频| 91麻豆国产自产在线观看| 国产婷婷色一区二区三区四区 | 欧美日韩激情一区| 亚洲色图在线播放| 成人aaaa免费全部观看| 久久先锋影音av| 久久91精品国产91久久小草 | 国产三级欧美三级日产三级99 | 国产欧美日韩综合| 久久99久久99小草精品免视看| 欧美三级中文字| 亚洲综合在线观看视频| 99re6这里只有精品视频在线观看| www久久久久| 激情久久久久久久久久久久久久久久| 欧美日韩一区小说| 亚洲国产日韩精品| 欧美丝袜丝交足nylons图片| 一区二区三区欧美久久| 91免费在线视频观看| 亚洲色图.com| 色综合久久中文综合久久牛| 亚洲欧美另类在线| 日本黄色一区二区| 亚洲国产日日夜夜|