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

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

?? ch16.htm

?? 一天之內學會VC#. 主要介紹VC#的各種應用和示例
?? 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 16 -- Up-Down, Progress, and Slider 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="../ch15/ch15.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch17/ch17.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 16 -<BR>Up-Down, Progress, and Slider Controls</FONT></H1><P>In this hour, you will learn about controls that were first offered in Windows95:<UL>	<LI>The up-down or spin control<BR>	<BR>		<LI>The slider control, also known as the trackbar control<BR>	<BR>		<LI>The progress control</UL><P>You will build one sample program in this hour. As each control is discussed,it will be added to the sample project.<H2><FONT COLOR="#000077"><B>A Common Control Overview</B></FONT></H2><P>When Windows 95 was released, it included a number of brand-new controls. Thesecontrols, known collectively as the common controls, added exciting features to theWindows user interface. The controls covered in this book, along with their associatedMFC classes, are shown in Table 16.1.<H4><FONT COLOR="#000077">Table 16.1. Some common controls and their MFC classes.</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>Class</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Image List</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CImageList</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">List</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CListCtrl</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Progress</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CProgressCtrl</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Slider (Trackbar)</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CSliderCtrl</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Up-down (Spin)</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CSpinButtonCtrl</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Tree</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CTreeCtrl</TT></TD>	</TR></TABLE><H2><FONT COLOR="#000077"><B>Using the Up-Down Control</B></FONT></H2><P>The up-down control, often called the spin control, is a pair of small arrowsthat resemble the ends of a scrollbar but are smaller. Up-down controls are oftenused to adjust the value of another control that is associated with the up-down control.</P><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>The control that is pairedwith the up-down control is known as the <I>buddy</I> <I>control</I>. The buddy controlis normally an edit control.</P><P>An up-down control can also be aligned horizontally. A horizontal up-down controlis not called a left-right control; it keeps its original name.</P><P>By default, clicking the up arrow decreases the value of the buddy control, andclicking the down arrow increases the value contained in the buddy control. The upand down arrows work a lot like a scrollbar in a word-processing document--clickingthe up arrow moves you to a lower-numbered page, clicking the down arrow moves youto a higher-numbered page. This behavior is confusing to most people; fortunately,it's easy to change, as you see in the section &quot;Changing the Behavior of theUp-Down Control.&quot;</P><P>Up-down controls are ideal for situations where a set of values can be scrolledby a user. If the user needs to adjust the values by only a few units, an up-downcontrol is perfect because it enables the user to select a new value with only afew mouse clicks.</P><P>An up-down control is very easy to use. To use the default functionality of theup-down control, you need to write exactly zero lines of source code! Even the mostadvanced uses for up-down controls require just a few lines of source code; mostof the code is written by ClassWizard.<H3><FONT COLOR="#000077"><B>The Sample Program</B></FONT></H3><P>For the examples created in this hour, you use a dialog box-based project namedControls. This project starts with an up-down control; later in the chapter, youadd a slider and a progress control.</P><P>To create the Controls project, use AppWizard to create a new project workspace.Select a dialog box-based project and click the Finish button.<H3><FONT COLOR="#000077"><B>Adding an Up-Down Control to a Dialog Box</B></FONT></H3><P>Adding an up-down control to the Controls dialog box is just like adding othercontrols. Open the main dialog box in the dialog box editor by selecting the ResourceViewtab in the project workspace and opening the Dialog folder. Open the <TT>IDD_CONTROLS_DIALOG</TT>by double-clicking the dialog box icon or by right-clicking the icon and selectingOpen from the pop-up menu. To place the up-down control, you can either drag anddrop the control from the control palette to the main dialog box, or you can selectthe up-down control on the tool palette using the mouse and then click the desiredposition in the main dialog box.</P><P>Open the Properties dialog box for the up-down control by right-clicking the controland selecting Properties from the pop-up menu. Change the control's resource ID to<TT>IDC_SPIN</TT>. All other properties should be set to their default values.<H3><FONT COLOR="#000077"><B>Up-Down Control Properties</B></FONT></H3><P>As with other controls, up-down controls have properties that you can change usingthe Developer Studio resource editor. The properties available for an up-down controlinclude the following:<UL>	<LI><I>ID</I> is used for the up-down control's resource ID. A default resource ID,	such as <TT>IDC_SPIN1</TT>, is supplied by Developer Studio.<BR>	<BR>		<LI><I>Visible</I> is used to indicate that the control is initially visible. This	check box is usually checked.<BR>	<BR>		<LI><I>Disabled</I> is used to indicate the control should be initially disabled.	This check box is usually cleared.<BR>	<BR>		<LI><I>Group</I> is used to mark the first control in a group. This check box is	usually cleared.<BR>	<BR>		<LI><I>Tab Stop</I> indicates that this control can be reached by pressing Tab on	the keyboard. This check box is usually left unchecked; this is different from most	controls, due to the fact that the up-down control is typically used to change the	value of the buddy control. Normally the buddy control has the <TT>tabstop</TT> property	enabled.<BR>	<BR>		<LI><I>Help ID</I> indicates that a context-sensitive help ID should be generated	for this control.<BR>	<BR>		<LI><I>Orientation</I> indicates whether the up-down control should be vertical or	horizontal. The default selection is vertical.<BR>	<BR>		<LI><I>Alignment</I> specifies how the buddy control and up-down control are associated	with each other. Possible values are Right, Left, and Unattached. The default value	is Unattached, but in most cases, you should select Left or Right.<BR>	<BR>		<LI><I>Auto Buddy</I> indicates whether the up-down control should use the previous	control in the tab order as its buddy control. This check box is cleared by default	but should be checked in most cases. If this box is not checked, the up-down control	will not be associated with a buddy control. You can still form this association	by command, which is discussed in the next section.<BR>	<BR>		<LI><I>Set Buddy Integer</I> indicates that the up-down control should set the value	of the attached buddy control. This check box is cleared by default but should be	checked in most cases.	<LI><I>No Thousands</I> indicates that no separator should be provided for a value	greater than 1,000 in the up-down control. This check box is usually cleared.<BR>	<BR>		<LI><I>Wrap</I> indicates that the up-down control should &quot;wrap around&quot;	after reaching its minimum or maximum value. If this option is not selected, the	up-down control stops after reaching its minimum or maximum limit. This check box	is usually cleared.<BR>	<BR>		<LI><I>Arrow Key</I> indicates that the keyboard's arrow keys can be used to change	the value of the up-down control. This check box is usually cleared.</UL><H3><FONT COLOR="#000077"><B>Adding a Buddy Control</B></FONT></H3><P>The easiest way to add a buddy control to an up-down control requires no sourcecode; instead, you use the dialog box editor. Follow these steps to associate anedit control with an up-down control:<DL>	<DD>1. Add an edit control to the dialog box. Most users expect the up-down control	to be placed against the buddy control; it helps emphasize the connection between	the two controls.<BR>	<BR>	2. Open the properties dialog box for the edit control and change the resource ID	to <TT>IDC_EDIT</TT>. All other properties should be set to their default values.<BR>	<BR>	3. Set the tab order for the edit control so that it is the control immediately before	the up-down control. You can select the tab order by choosing Tab Order from the	Layout menu (or press Ctrl+D). Each control is displayed with a small label that	represents the control tab order. To change the tab order, use the mouse to click	each control in the new tab order sequence.<BR>	<BR>	4. Open the properties dialog box for the up-down control and set the alignment value	to Right. This aligns the up-down control on the right side of the buddy control.<BR>	<BR>	5. Keep the Properties dialog box open and check the Auto Buddy and Set Buddy Integer	check boxes.</DL><P>The <TT>IDD_CONTROLS_DIALOG</TT> with an up-down control and the buddy edit controlis shown in Figure 16.1.</P><P><A NAME="04"></A><A HREF="04.htm"><B>Figure 16.1.</B></A> <I><BR>The main dialog box used in the Controls sample program, including the up-down controland buddy control.</I></P><P>Believe it or not, that's all there is to using an up-down control. If you compileand execute the Controls project, you can use the up-down control to change the valuecontained in the edit control.<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>CAUTION:</B></FONT><B> </B>Assigning a tab stop	to an up-down control tends to confuse the user. The focus feedback given to the	user is very subtle and easily overlooked. Also, the buddy control and up-down button	are normally paired into a single logical control. For these reasons, you should	not set the tab stop property for the up-down control in most cases. <HR></BLOCKQUOTE><P>To set, validate, or retrieve the value of the edit control, use ClassWizard toassociate a <TT>CEdit</TT> object with the edit control or use one of the other techniquesdiscussed in Chapter 6, &quot;Using Edit Controls.&quot;<BLOCKQUOTE>	<P><HR><FONT COLOR="#000077"><B>DO/DON'T:</B></FONT><B> <BR>	DO</B> associate a buddy control with the up-down control.<BR>	<B>DO</B> set a limit for the up-down control.<BR>	<B>DO</B> make the buddy control precede the up-down control in the tab order.<BR>	<B>DON'T</B> set the tabstop property for the up-down control. <HR></BLOCKQUOTE><H3><FONT COLOR="#000077"><B>Using the <TT>CSpinButtonCtrl</TT> Class</B></FONT></H3><P>The MFC class <TT>CSpinButtonCtrl</TT> can be used to manage an up-down control.Use ClassWizard to associate the <TT>IDC_SPIN</TT> control with a <TT>CSpinButtonCtrl</TT>object, using the values from Table 16.2.<H4><FONT COLOR="#000077">Table 16.2. Values used to add a CSpinButtonCtrl membervariable for CControlsDlg.</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>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_SPIN</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>m_spin</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>Control</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CSpinButtonCtrl</TT></TD>	</TR></TABLE><H3><FONT COLOR="#000077"><B>Changing the Behavior of the Up-Down Control</B></FONT></H3><P>As discussed earlier, the default behavior for an up-down control is to incrementthe control if the down arrow is clicked and decrement the control if the up arrowis clicked. You can change this behavior by reversing the range of the up-down control.</P><P>To change the range of an up-down control, use the <TT>CSpinButtonCtrl</TT>'s<TT>SetRange</TT> function.</P><P><TT>SetRange</TT> has two parameters: the first parameter is the lower-limit valuefor the control, the second parameter is the upper limit:</P><PRE><FONT COLOR="#0066FF"><TT>m_spin.SetRange( 100, 0 );</TT></FONT></PRE><P>To set a new range for the up-down control, add the source code from Listing 16.1to the <TT>CControlsDlg::OnInitDialog</TT> member function. This source code shouldbe added just after the <TT>// TODO</TT> comment.<H4><FONT COLOR="#000077">TYPE: Listing 16.1. Setting the range for an up-down control.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>// TODO: Add extra initialization here</TT></FONT></PRE><P><TT>m_spin.SetRange( 0, 100 );</TT> Compile and execute the Controls project.The up-down control increments the edit control when its up arrow is clicked anddecrements the edit control when the down arrow is clicked.<H2><FONT COLOR="#000077"><B>Using the Slider Control</B></FONT></H2><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>A <I>slider control</I>,also known as a trackbar control, is a control that contains a slide bar that youcan move between two points. A slider is used in the Display applet that is partof the Windows Control Panel. The Settings property page uses a slider to set thescreen resolution.</P><P>The user moves the slide bar by dragging it with the mouse or by setting the keyboardfocus to the slider and using the arrow keys on the keyboard. You can create sliderswith optional tick marks that help the user to judge the position of the slide bar.<H3><FONT COLOR="#000077"><B>Deciding When to Use a Slider Control</B></FONT></H3><P>Sliders are useful when a user is asked to select a value within a certain range.A slider gives the user immediate feedback about the control's current value, aswell as the value's relationship to the high and low ranges.</P><P>Sliders are added to dialog boxes just like other controls; just drag and dropthe control from the controls palette to the dialog box. Although you can createa slider from scratch, it's much easier to add one in the Developer Studio dialogbox editor.</P><P>Open the <TT>IDD_CONTROLS_DIALOG</TT> resource and add a slider control by dragginga slider control from the control palette and dropping it on the dialog box. Figure

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区国产豹纹内裤在线| 国产婷婷色一区二区三区| 国产成人午夜高潮毛片| 五月婷婷综合激情| 偷拍一区二区三区| 午夜精品123| 蜜桃av一区二区在线观看| 亚洲国产精品久久人人爱| 亚洲女同一区二区| 亚洲一区二区欧美日韩| 丝袜诱惑亚洲看片| 奇米888四色在线精品| 久久99国产精品尤物| 韩国女主播一区| 不卡影院免费观看| 在线视频综合导航| 欧美日韩高清在线播放| 日韩欧美不卡在线观看视频| 日韩三级电影网址| 欧美国产一区视频在线观看| 亚洲欧洲日产国码二区| 亚洲一区二区三区小说| 免费看日韩精品| 国产成人精品三级麻豆| 在线免费视频一区二区| 4hu四虎永久在线影院成人| 久久久国产午夜精品 | 欧美一区二区三区视频| 日韩欧美国产系列| 成人欧美一区二区三区小说 | 99久久精品免费| 欧美日本国产一区| 国产午夜三级一区二区三| 亚洲人午夜精品天堂一二香蕉| 亚洲va国产va欧美va观看| 精品一区二区影视| 色婷婷av一区二区三区gif| 精品少妇一区二区三区视频免付费| 国产日韩欧美不卡在线| 亚洲综合色噜噜狠狠| 国产一区二区三区免费播放| 色婷婷久久久久swag精品| 欧美精品一级二级| 国产精品成人在线观看| 麻豆一区二区三| 欧美性生交片4| 欧美激情一区二区三区四区| 日本成人在线视频网站| 99re在线精品| 综合av第一页| 黄网站免费久久| 欧美精选一区二区| 亚洲视频狠狠干| 岛国一区二区三区| 日韩亚洲欧美一区二区三区| 亚洲精品少妇30p| 高清不卡在线观看av| 日韩精品一区二区三区视频在线观看| 亚洲午夜久久久久| 97se亚洲国产综合在线| 国产清纯美女被跳蛋高潮一区二区久久w | 欧美性猛片xxxx免费看久爱| 国产精品私房写真福利视频| 国产麻豆欧美日韩一区| 日韩午夜在线影院| 奇米888四色在线精品| 欧美日韩一区不卡| 亚洲一区二区三区四区五区中文 | 有码一区二区三区| 色婷婷综合视频在线观看| 成人欧美一区二区三区1314| 国产精品88av| 久久精品一区二区三区av| 激情图片小说一区| 久久先锋影音av鲁色资源网| 久热成人在线视频| 欧美成人a视频| 国内外成人在线| 久久久久高清精品| 丁香桃色午夜亚洲一区二区三区| 国产欧美va欧美不卡在线| 丰满少妇久久久久久久| 国产精品私人自拍| 91美女蜜桃在线| 亚洲风情在线资源站| 3atv一区二区三区| 精品一区二区三区久久久| 久久综合九色综合久久久精品综合| 久久精品国产99| 国产精品视频第一区| 色老汉一区二区三区| 亚洲成人av电影在线| 日韩欧美123| 成人网页在线观看| 亚洲精品国产高清久久伦理二区| 欧美在线不卡一区| 久久精品国产精品青草| 中文字幕巨乱亚洲| 欧美天堂亚洲电影院在线播放| 美女视频免费一区| 国产精品久久久久久久久搜平片 | 精品欧美一区二区三区精品久久| 国产精品自在在线| 亚洲乱码日产精品bd| 欧美日韩精品一区二区三区 | 成人精品亚洲人成在线| 亚洲午夜三级在线| 国产欧美中文在线| 欧美久久久久免费| av在线不卡观看免费观看| 亚洲第一综合色| 国产亚洲短视频| 欧美精品久久99久久在免费线| 国产一区二区调教| 亚洲午夜久久久久中文字幕久| 337p粉嫩大胆色噜噜噜噜亚洲 | 免费在线看一区| 亚洲欧美一区二区不卡| 日韩免费性生活视频播放| 国产高清不卡一区二区| 亚洲www啪成人一区二区麻豆 | 亚洲精品成人天堂一二三| 日韩欧美另类在线| 中文字幕中文字幕中文字幕亚洲无线 | 久久久久久日产精品| 欧美精品亚洲二区| 99re这里都是精品| 激情国产一区二区| 日本欧洲一区二区| 一区二区三区资源| 中文字幕巨乱亚洲| 亚洲精品一线二线三线| 欧美日韩免费在线视频| av一区二区不卡| 国产精品一区二区视频| 日本不卡一区二区三区| 亚洲丰满少妇videoshd| 亚洲精品国产一区二区精华液| 国产精品网曝门| 中国色在线观看另类| 26uuu亚洲综合色欧美| 日韩一级大片在线观看| 在线播放中文字幕一区| 欧美日韩一区二区三区不卡| 欧美影片第一页| 色呦呦国产精品| 91亚洲精品久久久蜜桃| 波多野结衣亚洲一区| 丁香网亚洲国际| yourporn久久国产精品| 波多野结衣中文一区| 99久久99久久免费精品蜜臀| 欧美成人午夜电影| 69久久99精品久久久久婷婷| 欧美亚洲高清一区二区三区不卡| 色又黄又爽网站www久久| 在线免费视频一区二区| 欧美三级韩国三级日本一级| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 精品国产三级电影在线观看| 久久综合九色欧美综合狠狠| 欧美videossexotv100| 精品国产乱码久久久久久图片| 日韩一区二区三区在线| 精品久久久久久无| 久久久久久一二三区| 中文字幕乱码久久午夜不卡| 亚洲丝袜另类动漫二区| 亚洲成av人片在线观看| 青青草成人在线观看| 国产成人自拍网| 色综合激情五月| 5566中文字幕一区二区电影| 精品国产91久久久久久久妲己| 国产视频不卡一区| 自拍偷在线精品自拍偷无码专区 | 精品一区二区三区免费播放| 欧美喷水一区二区| 欧美zozo另类异族| ㊣最新国产の精品bt伙计久久| 亚洲成a人v欧美综合天堂| 激情伊人五月天久久综合| 国产传媒欧美日韩成人| 欧美三级韩国三级日本三斤| 日韩欧美另类在线| 亚洲视频1区2区| 精品一区二区三区视频| 91福利视频在线| 久久日韩精品一区二区五区| 亚洲精品国产一区二区精华液 | 国产传媒久久文化传媒| 欧美亚洲尤物久久| 国产偷国产偷精品高清尤物| 亚洲一区二区在线播放相泽| 国产精品456露脸| 欧美人体做爰大胆视频| 国产精品久久毛片a| 久久精品国产77777蜜臀| 91国产视频在线观看| 国产日韩精品一区二区三区|