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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ch20.htm

?? 一天之內(nèi)學(xué)會VC#. 主要介紹VC#的各種應(yīng)用和示例
?? HTM
?? 第 1 頁 / 共 2 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD>		<META NAME="GENERATOR" Content="Symantec Visual Page Mac 1.1">	<TITLE>Teach Yourself Visual C++&#174; 5 in 24 Hours -- Hour 20 -- Using ActiveX Controls</TITLE></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF"><H1 ALIGN="CENTER"><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><P><A HREF="../ch19/ch19.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch21/ch21.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><H1 ALIGN="CENTER"><FONT COLOR="#000077">- Hour 20 -<BR>Using ActiveX Controls</FONT></H1><P>ActiveX controls enable you to reuse custom controls written for Windows. In thishour, I discuss ActiveX controls and how they are used. In this hour, you will learn<UL>	<LI>How ActiveX controls are used to replace OLE controls and VBX controls<BR>	<BR>		<LI>How you can use ActiveX controls to easily add functionality to your project<BR>	<BR>		<LI>How to use the Microsoft FlexGrid control included with Visual C++</UL><P>A small example at the end of the hour uses one of the ActiveX controls includedwith Visual C++.<H2><FONT COLOR="#000077"><B>What Is an ActiveX Control?</B></FONT></H2><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>An <I>ActiveX control</I>is a reusable control that is packaged and available for use in your applications.ActiveX controls use Object Linking and Embedding (OLE) interfaces for communicationto and from the control.</P><P>ActiveX controls can be developed for both the 16-bit and 32-bit versions of Windows.In addition, they have features that make them more attractive for distribution,such as support for licensing and localization into different languages.</P><P>A wide range of ActiveX controls is available. Later in this hour, you can followthe steps required to use the Microsoft FlexGrid control that is included with VisualC++, which enables you to write simple spreadsheet applications.<H2><FONT COLOR="#000077"><B>Why Use an ActiveX Control?</B></FONT></H2><P>ActiveX controls are easy to use in your MFC-based applications because they havebeen designed for reuse. Developer Studio includes the Component and Controls Gallery,a tool that helps you easily integrate ActiveX controls into your MFC programs.</P><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>ActiveX controls communicateover well-defined <I>interfaces</I> that are understood by ActiveX controls and theprograms that use them. These interfaces are used to pass information and eventsto and from the control.</P><P>Because ActiveX controls use a standard interface that is not specific to anyparticular programming language, ActiveX controls can be used by a variety of developmenttools. The ActiveX controls that you use today in a Visual C++ program can also beused with other tools, such as Access 95, Visual FoxPro, and Visual Basic.</P><P>ActiveX controls offer more functionality than is available with standard controlsoffered by Windows. For example, before the release of Windows 95, many VBX vendorsoffered VBX controls that were similar to tree view controls; these vendors are nowoffering ActiveX controls with features that are not available when using standardcontrols.<H2><FONT COLOR="#000077"><B>How Is an ActiveX Control Used?</B></FONT></H2><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>An ActiveX <I>event</I> isa message that is sent from the control to the application that contains the control.</P><P>An ActiveX control always communicates with an ActiveX control container. Controlcontainers understand the ActiveX control interfaces, as shown in Figure 20.1. AnActiveX control container is responsible for providing an environment in which thecontrol can pass events to its owner and receive information from the outside world.The ActiveX control sends events to the ActiveX container when an event occurs insidethe control. Mouse clicks, pressed buttons, and expiring timers are examples of events.The ActiveX container provides information to the control such as the natural or&quot;ambient&quot; background color and the default font.</P><P><A NAME="01"></A><A HREF="01.htm"><B>Figure 20.1.</B> </A><I><BR>Messages sent to and from ActiveX controls in an MFC program.</I></P><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>An ActiveX <I>property</I>is an attribute that is applied to the control, such as a color or the height ofa button.</P><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>An ActiveX <I>method</I>is a function that is exposed by the control and is called by the control's container.</P><P>When an ActiveX control container must communicate with an ActiveX control, itinteracts with a set of properties and methods that are exposed by the ActiveX control.An example of an ActiveX property is the font or background color used by a control.An example of an ActiveX method is a function that sorts the items in a list control.</P><P>Every class derived from <TT>CWnd</TT> in an MFC application can be used as anActiveX control container. The MFC class <TT>COleControl</TT> is used as a base classfor all ActiveX controls created using MFC.<H3><FONT COLOR="#000077"><B>Using the Components and Controls Gallery</B></FONT></H3><P>The Developer Studio Components and Controls Gallery is used to store reusablecomponents that can be used in your MFC-based Windows projects. If you develop aclass that you would like to reuse in future projects, you can add the class to theGallery by following these steps:<DL>	<DD>1. Open the ClassView in the project workspace.<BR>	<BR>	2. Right-click on the class name, and select Add to Gallery from the shortcut menu.</DL><P>The most frequently used components stored in the Components and Controls Galleryare ActiveX controls. To display all the ActiveX controls available on your machine,open the Components and Controls Gallery by selecting Project | Add to Project |Components and Controls from the main menu.</P><P>After the Component Gallery dialog box is displayed, select Registered ActiveXControls from the list box; this displays all the available ActiveX controls, asshown in Figure 20.2.</P><P><A NAME="02"></A><A HREF="02.htm"><B>Figure 20.2.</B> </A><I><BR>Displaying available ActiveX controls in the Component Gallery.</I><H3><FONT COLOR="#000077"><B>Adding an ActiveX Control to the Dialog Editor</B></FONT></H3><P>Before using an ActiveX control in a dialog box, you must insert the control intothe dialog editor's control palette. To add an ActiveX control to the dialog editor,follow these steps:<DL>	<DD>1. Select one of the displayed ActiveX control icons.<BR>	<BR>	2. From the Components and Controls Gallery dialog box, click the Insert button.<BR>	<BR>	3. A message box will be displayed asking if you would like to insert the component.	Click OK.<BR>	<BR>	4. A list box containing classes that will be added to your project is displayed	inside the Confirm Classes dialog box. Click OK to add the classes to your project.<BR>	<BR>	5. Click the Close button to dismiss the Components and Controls Gallery dialog box.</DL><P>The ActiveX control you selected is now included in the dialog editor's controlpalette. Open a dialog box for editing, and you see the new control palette, includingthe new ActiveX control.</P><P>You can use the new ActiveX control as you would any other control. To add itto a dialog box resource, drag and drop the control on the dialog box, or selectthe ActiveX control's icon and click on the dialog box resource.<H3><FONT COLOR="#000077"><B>Using ClassWizard to Configure an ActiveX Control</B></FONT></H3><P>Before you can use the ActiveX control, it must be integrated into your project.As with any other control added to a dialog box, use ClassWizard to add message-handlingfunctions and associate the control with an MFC object.</P><P>When adding a member variable associated with an ActiveX control, you can useClassWizard as you would if the control were a button, list box, or another standardWindows control. Unlike standard Windows controls, each ActiveX control has a largenumber of variable types. In addition to the object used to interact with the control,every property exposed by the control can be associated with a variable.<H2><FONT COLOR="#000077"><B>An Example Using an ActiveX Custom Control</B></FONT></H2><P>As an example of using an ActiveX control in an MFC-based project, you will nowuse the Microsoft FlexGrid control in a dialog box-based application. The grid controlis used to create a small spreadsheet in the main dialog box.</P><P>To get started with the sample project, use AppWizard to create a dialog box-basedapplication named CustomCtrl. In contrast to most of the book's other AppWizard examples,for this project you must keep one of the default options offered by the wizard.On the second AppWizard page, make sure the ActiveX Controls check box is selected.Selecting this option causes AppWizard to configure the project to be ActiveX control-ready.<H3><FONT COLOR="#000077"><B>What Is a Grid Control?</B></FONT></H3><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>A <I>grid control</I> isa popular reusable component that is similar to a spreadsheet. Many suppliers ofVisual Basic controls offer grid controls, and Microsoft includes with DeveloperStudio an ActiveX grid control named FlexGrid.</P><P>As you can probably guess by its name, a grid control is divided into a seriesof rectangles, or grids. Vertical lines separate the controls into columns, and horizontallines divide the control into rows. The intersection of a row and column is knownas a <I>cell</I>.</P><P>A grid control can contain a mixture of images and text. In most cases, text isused. You cannot directly edit the individual cells in a grid control. The grid controlis strictly a read-only window, although there are ways to simulate cell editingthat are discussed later this hour.</P><P>The most common use for a grid control is creating a small spreadsheet. If youwant to display a small budget or other information, a grid control is ideal. Inaddition, you can use a grid control whenever you must arrange information into rowsand columns. For example, a calendar dialog box might use a grid control to provideaccess to the individual days of the month.</P><P>A grid control spares you the work of creating and maintaining a large numberof smaller controls. The grid control tracks the active cell, as well as the sizeand contents of each cell. When you need access to a particular cell, the grid controlcan provide that information through a function call. At a minimum, grid controlsenable you to do the following:<UL>	<LI>Retrieve current row, cell, and column information.<BR>	<BR>		<LI>Set attributes for the current cell, such as font, size, and contents.<BR>	<BR>		<LI>Retrieve the attributes of the current cell.</UL><H3><FONT COLOR="#000077"><B>Adding a Grid ActiveX Control to the Dialog Editor</B></FONT></H3><P>To add a grid ActiveX control to the CustomCtrl project's main dialog box, youmust first add the grid control to the dialog editor's control palette by followingthese steps:<DL>	<DD>1. Open the Components and Controls Gallery by selecting Project | Add to Project	| Components and Controls from the main menu.<BR>	<BR>	2. Display the available ActiveX controls by clicking Registered ActiveX Controls	from the list box.<BR>	<BR>	3. Select the Microsoft FlexGrid, version 5.0 Control icon and then click the Insert	button; then click OK on the message box.<BR>	<BR>	4. Accept the list of classes that will be added to the project by clicking OK.<BR>	<BR>	5. Close the Components and Controls Gallery dialog box.</DL><H3><FONT COLOR="#000077"><B>Adding a Grid Control to the Main Dialog Box</B></FONT></H3><P>Before adding the grid control to the main dialog box, you must first load thedialog box resource into the dialog editor. Open the ResourceView in the projectworkspace. Open the dialog box resource folder and double-click the <TT>IDD_CUSTOMCTRL_DIALOG</TT>icon. This opens the dialog box resource inside the Developer Studio dialog editor.</P><P>To add a grid control, drag and drop the grid control from the control paletteto the dialog box resource. For this example, you must also add an edit control witha resource ID of <TT>IDC_EDIT</TT> and a pushbutton control with an ID of <TT>IDC_CALC</TT>to the dialog box. The finished main dialog box resource is shown in Figure 20.3.</P><P><A NAME="03"></A><A HREF="03.htm"><B>Figure 20.3.</B></A> <I><BR>The main dialog box resource for the <TT>CustomCtrl</TT> project.</I></P><P>The properties for the ActiveX grid control are provided in Table 20.1. Use thedefault properties for the edit control.<H4><FONT COLOR="#000077">Table 20.1. Properties used for the ActiveX grid control.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>Property</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Value</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>ID</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_GRID</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>Rows</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>5</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>Cols</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>5</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>FixedRows</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>1</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>FixedCols</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>1</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>ScrollBars</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">None</TD>	</TR></TABLE><H3><FONT COLOR="#000077"><B>Initializing the Grid Control</B></FONT></H3><P>Before adding the source code used to initialize the grid control, add membervariables to the <TT>CCustomCtrlDlg</TT> class associated with the grid and editcontrols. Using ClassWizard, add the member variables using the values from Table20.2.<H4><FONT COLOR="#000077">Table 20.2. Values used for the grid and edit control membervariables.</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>Resource ID</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>Variable Name</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CCustomCtrlDlg</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_EDIT</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>Control</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CEdit</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>m_edit</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CCustomCtrlDlg</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_GRID</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>Control</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CMSFlexGrid</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>m_grid</TT></TD>	</TR></TABLE><BLOCKQUOTE>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人精品免费在线| 4438x亚洲最大成人网| 成人国产在线观看| 欧美美女网站色| 国产女人aaa级久久久级 | 欧美日韩中字一区| 久久―日本道色综合久久| 亚洲影视在线观看| 成人免费看黄yyy456| 91精品国产一区二区| 亚洲精品国产a| 成人黄色国产精品网站大全在线免费观看 | 亚洲精品高清视频在线观看| 欧美无砖砖区免费| 亚洲欧美色综合| 国产·精品毛片| 亚洲精品一线二线三线| 亚洲成av人在线观看| 一本大道av伊人久久综合| 国产精品久久久久久久久免费相片| 麻豆精品久久精品色综合| 欧美日韩精品一区二区在线播放| 亚洲乱码一区二区三区在线观看| 欧美亚洲日本一区| 国内久久婷婷综合| 久久久高清一区二区三区| 99久久久国产精品免费蜜臀| 中文字幕免费不卡| 丁香五精品蜜臀久久久久99网站| 夜夜嗨av一区二区三区中文字幕 | 91婷婷韩国欧美一区二区| 国产清纯白嫩初高生在线观看91| 波多野结衣一区二区三区| 国产精品久久久久久久久图文区 | 国产精品久线在线观看| 欧美精品日日鲁夜夜添| 国产福利一区在线观看| 亚洲国产综合91精品麻豆| 欧美日韩精品高清| 国产夫妻精品视频| 水野朝阳av一区二区三区| 91精品国产欧美一区二区18| 国产91精品露脸国语对白| 午夜精品久久久久久久久| 91精品婷婷国产综合久久竹菊| 懂色av噜噜一区二区三区av| 午夜精品视频在线观看| 国产精品丝袜91| 色女孩综合影院| 亚洲欧美日本韩国| 国产亚洲一二三区| 一本久久综合亚洲鲁鲁五月天| 精品一区二区三区不卡| 国产精品久久看| 精品免费国产二区三区| 成人app软件下载大全免费| 精品亚洲国内自在自线福利| 亚洲主播在线播放| 国产精品久久久久一区二区三区| 欧美一级欧美三级在线观看| 91久久一区二区| 成人av在线网站| 国产成人精品网址| 国产一区二区主播在线| 最新高清无码专区| 日韩欧美国产一区二区在线播放| 成人激情av网| 国产一区 二区| 蜜臀久久99精品久久久画质超高清| 一区二区三区在线免费播放| 最近中文字幕一区二区三区| 中文文精品字幕一区二区| 久久免费美女视频| www一区二区| 欧洲精品一区二区三区在线观看| 麻豆精品一区二区av白丝在线| 午夜视频在线观看一区二区三区| 亚洲在线成人精品| 亚洲欧美日韩精品久久久久| 亚洲日本护士毛茸茸| 中文字幕一区二区三中文字幕| 在线不卡免费欧美| 91精品国产色综合久久ai换脸| 欧美丰满美乳xxx高潮www| 欧美日韩亚洲高清一区二区| 欧美乱妇23p| 91精品国产福利| 精品久久久久久综合日本欧美| 精品久久99ma| 久久久久久免费毛片精品| 国产日韩精品一区二区浪潮av| 久久综合色之久久综合| 国产片一区二区三区| 亚洲视频资源在线| 亚洲一区免费观看| 日韩高清在线电影| 亚洲一区自拍偷拍| 日本va欧美va精品| 亚洲综合一二三区| 天堂va蜜桃一区二区三区漫画版| 日日欢夜夜爽一区| 国产一区二区看久久| 东方欧美亚洲色图在线| 色婷婷综合久久久| 欧美一区二区三区日韩视频| 久久久亚洲国产美女国产盗摄 | 亚洲欧美一区二区不卡| 亚洲成国产人片在线观看| 六月丁香婷婷色狠狠久久| 日韩国产在线观看一区| 精品一区二区影视| 91网站最新地址| 欧美久久婷婷综合色| 欧美videofree性高清杂交| 国产精品入口麻豆九色| 亚洲成av人影院| 国产精品88av| 成人性视频免费网站| 欧美性色黄大片| 久久精品欧美一区二区三区麻豆| 亚洲欧洲日本在线| 美女一区二区在线观看| 99久久免费视频.com| 欧美一区二区在线免费播放| 中文字幕免费在线观看视频一区| 亚洲成人一区二区在线观看| 国产精品一卡二卡在线观看| 欧美日韩中文精品| 国产精品入口麻豆原神| 日本欧美大码aⅴ在线播放| 99综合电影在线视频| 日韩精品影音先锋| 一级女性全黄久久生活片免费| 精品一区二区三区在线观看| 欧美三级电影网站| 中文字幕一区二区5566日韩| 久久成人综合网| 欧美日本精品一区二区三区| 国产精品久久久久影院色老大| 另类小说图片综合网| 在线区一区二视频| 欧美国产精品v| 韩国精品在线观看| 91精品国产一区二区三区香蕉| 亚洲人快播电影网| 国产成人aaa| 欧美成人一级视频| 日本不卡不码高清免费观看| 色诱视频网站一区| 国产精品家庭影院| 国产精品资源网| 日韩女优毛片在线| 日本不卡视频一二三区| 欧美日韩电影一区| 亚洲大片免费看| 色悠久久久久综合欧美99| 中文成人综合网| 成人黄色av网站在线| 欧美国产一区在线| 国产精品99久久不卡二区| 欧美成人精品二区三区99精品| 亚洲v日本v欧美v久久精品| 欧美在线视频不卡| 又紧又大又爽精品一区二区| 成人91在线观看| 国产精品久久久久aaaa| 国产.欧美.日韩| 欧美精彩视频一区二区三区| 国产乱人伦精品一区二区在线观看| 日韩一区二区视频| 亚洲欧美另类综合偷拍| 97精品视频在线观看自产线路二| 国产精品天干天干在观线| 风间由美一区二区av101 | 色综合天天综合| 久久久国产精品午夜一区ai换脸| 韩国毛片一区二区三区| 久久嫩草精品久久久精品| 国产成人日日夜夜| 国产精品乱子久久久久| va亚洲va日韩不卡在线观看| 亚洲欧美在线观看| 91久久奴性调教| 亚洲国产日产av| 欧美一二三四在线| 国产一区二区精品在线观看| 国产亚洲欧美日韩在线一区| 成人精品高清在线| 一区二区欧美视频| 欧美丰满少妇xxxxx高潮对白| 日本va欧美va欧美va精品| 久久久夜色精品亚洲| 丁香一区二区三区| 一区二区三区在线观看国产| 91精品国产综合久久福利软件| 久久国产精品色| 国产精品美女久久久久久久| 色94色欧美sute亚洲线路一久| 性久久久久久久| 久久一夜天堂av一区二区三区|