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

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

?? ch05.htm

?? 24小時(shí)精通VC
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<H3><FONT COLOR="#000077"><B>What Are Radio Buttons?</B></FONT></H3>
<P>Radio buttons are used when a selection must be made from several mutually exclusive
options, such as a user's gender. Only one of the radio buttons, which usually are
grouped together, is checked at any particular time.
<H3><FONT COLOR="#000077"><B>What Are Check Boxes?</B></FONT></H3>
<P>Check boxes are used as Boolean flags that indicate whether a particular condition
is <TT>true</TT> or <TT>false</TT>. Unlike radio buttons, several check boxes in
a group can be checked. Optionally, a check box can support a third state--disabled--meaning
that the control is neither <TT>true</TT> nor <TT>false</TT>.
<H3><FONT COLOR="#000077"><B>What Are Group Boxes?</B></FONT></H3>
<P>A group box logically groups controls that are used for similar purposes. This
helps the user understand the relationships between controls and makes a dialog box
easier to use. Radio buttons are almost always enclosed in a group box so that it's
obvious which controls are associated with each other.
<H3><FONT COLOR="#000077"><B>MFC Support for Buttons</B></FONT></H3>
<P>Button controls normally are created as part of a dialog box. After you add a
button to a dialog box, you can use ClassWizard to add functions that can be used
to handle events created when the button is pressed, checked, or selected. You also
use ClassWizard to create <TT>CButton</TT> objects that are associated with individual
button controls.</P>
<P>You can use the MFC class <TT>CButton</TT> to interact with button controls--both
buttons that have been added to a dialog box resource and buttons that have been
created dynamically. Use ClassWizard to associate a button control with a specific
<TT>CButton</TT> object.
<H3><FONT COLOR="#000077"><B>A Sample Project Using Buttons</B></FONT></H3>
<P>In order to see how button controls can be used with dialog boxes, create a dialog
box-based project named Button using AppWizard, following the steps provided in Hour
4, &quot;Dialog Boxes and C++ Classes.&quot; You will use this project for the rest
of this hour as an example of how to use buttons in a dialog box.</P>
<P>Click the ResourceView tab in the project workspace. Open the dialog box editor
by double-clicking the <TT>IDD_BUTTON_DIALOG</TT> icon in the Dialog resource folder.</P>
<P>The <TT>IDD_BUTTON_DIALOG</TT> dialog box is displayed in the dialog box editor,
along with a dockable control toolbar or palette. The floating control palette contains
all the controls available for a dialog box, as shown in Figure 5.1.</P>
<P><A NAME="01"></A><A HREF="01.htm" tppabs="http://www.mcp.com/824169600/0-672/0-672-31242-5/ch05/01.htm"><B>Figure 5.1.</B></A> <I><BR>
The floating control palette, showing the buttons and boxes needed to create basic
dialog boxes.</I></P>
<P>There are four different icons on the control palette for buttons, each used for
a particular button type. Use one of the following steps to add a button control
to a dialog box:

<UL>
	<LI>Drag a button control from the palette to the dialog box by pressing the left
	mouse button while over the control button, then dragging the mouse cursor to the
	dialog box with the left mouse button still pressed. Release the mouse button when
	the cursor is over the desired spot in the dialog box.<BR>
	<BR>
	
	<LI>Select a button control by clicking a control in the control palette. Click the
	desired location for the control in the dialog box, and the dialog box editor creates
	a control for you in that location.
</UL>

<P>These steps apply for all controls in the control palette. After you've added
a control to the dialog box, you can use the mouse to reposition and resize it.</P>
<P>As a demonstration, add several buttons to the main dialog box used in the Button
project. You will use these controls later this hour to demonstrate button events.
Refer to Figure 5.2 for the location of the added buttons.</P>
<P><A NAME="02"></A><A HREF="02.htm" tppabs="http://www.mcp.com/824169600/0-672/0-672-31242-5/ch05/02.htm"><B>Figure 5.2.</B></A> <I><BR>
The main dialog box used by the Button project.</I></P>
<P>A total of five buttons are added to <TT>IDD_BUTTON_DIALOG</TT>. Use the values
from Table 5.1 to set the properties for each control. Except for the ID and caption,
all controls use the default set of properties.
<H4><FONT COLOR="#000077">Table 5.1. Values used for controls in IDD_BUTTON_DIALOG.</FONT></H4>
<P>
<TABLE BORDER="1">
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT"><B>Control ID</B></TD>
		<TD ALIGN="LEFT"><B>Button Type</B></TD>
		<TD ALIGN="LEFT"><B>Caption</B></TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT"><TT>IDC_BTN_TEST</TT></TD>
		<TD ALIGN="LEFT">Pushbutton</TD>
		<TD ALIGN="LEFT">&amp;Test</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT"><TT>IDC_RADIO_HIGH</TT></TD>
		<TD ALIGN="LEFT">Radio button</TD>
		<TD ALIGN="LEFT">&amp;High</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT"><TT>IDC_RADIO_LOW</TT></TD>
		<TD ALIGN="LEFT">Radio button</TD>
		<TD ALIGN="LEFT">&amp;Low</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT"><TT>IDC_GROUP_VOLUME</TT></TD>
		<TD ALIGN="LEFT">Group control</TD>
		<TD ALIGN="LEFT">&amp;Volume</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT"><TT>IDC_CHECK_AMP</TT></TD>
		<TD ALIGN="LEFT">Check box</TD>
		<TD ALIGN="LEFT">&amp;Amplified</TD>
	</TR>
</TABLE>

<H4><FONT COLOR="#000077">Button Control Properties</FONT></H4>
<P>Like all controls, buttons have a set of properties that define the behavior of
each control. Although there are four different types of button controls, they share
a common set of properties. You can display the properties for a particular control
by selecting Properties from the menu displayed when you right-click the control.
These properties are shared by all button controls:

<UL>
	<LI>ID: Used for the button's resource ID. A default resource ID, such as <TT>IDC_BUTTON1</TT>,
	is supplied by Developer Studio. Using <TT>IDC_</TT> as a prefix for control resource
	IDs is a Microsoft naming convention.<BR>
	<BR>
	
	<LI>Caption: Indicates the text that appears as the button's label. Developer Studio
	supplies a default name, such as Button. To make one of the letters in the caption
	of a control the mnemonic key, precede it with an ampersand (&amp;).<BR>
	<BR>
	
	<LI>Visible: Indicates that the button is initially visible. This check box is normally
	checked.<BR>
	<BR>
	
	<LI>Disabled: Indicates that the button should be initially disabled. This check
	box is normally cleared.<BR>
	<BR>
	
	<LI>Group: Marks the first control in a group. All controls following a control with
	this attribute are considered part of the same group if this check box is cleared.
	A user can move between controls in the same group using the arrow keys.<BR>
	<BR>
	
	<LI>Tab Stop: Indicates that this control can be reached by pressing Tab on the keyboard.
	This check box is normally checked.<BR>
	<BR>
	
	<LI>Default Button: Marks this control as the dialog box's default button. There
	can be only one default button in a dialog box, and it is executed if the user presses
	Enter without using any other controls in the dialog box. This check box is normally
	cleared.<BR>
	<BR>
	
	<LI>Owner Draw: Indicates that the button will be drawn by the button's owner; in
	this case, the dialog box. In most cases, this check box is cleared.
</UL>

<P>Group boxes support the fewest properties of any button control. All button properties
are supported except <TT>Default Button</TT> and <TT>Owner Draw</TT>.</P>
<P>Radio buttons do not use the default button property because they aren't used
as default buttons. However, radio buttons do support two properties not used by
pushbutton controls:

<UL>
	<LI>Auto: Automatically changes the state of the control when it is selected. This
	check box is normally selected.<BR>
	<BR>
	
	<LI>Left Text: Places the control's label on the left side of the check box instead
	of the right. This check box is normally cleared.
</UL>

<P>Check boxes support the same properties as radio controls, except that they are
used with one additional attribute:

<UL>
	<LI>Tri-state: The check box can have three states instead of two. In addition to
	<TT>true</TT> and <TT>false</TT>, the control can be disabled, meaning that the value
	is neither <TT>true</TT> nor <TT>false</TT>.
</UL>

<P>In addition, all controls have a property page that is labeled Extended Styles.
These styles are rarely used, and aren't discussed in this book.
<H4><FONT COLOR="#000077">Using Standard Pushbutton Layouts in Your Dialog Boxes</FONT></H4>
<P>Several pushbuttons are commonly used in dialog boxes that contain controls. Because
each of these pushbuttons carries a specific meaning, you should try to use the standard
terminology whenever possible because it minimizes the amount of work required for
users of your programs. Here are the standard meanings for these buttons:

<UL>
	<LI>OK: Used to close and accept any information that is present in the dialog box.
	Any user-supplied information in the dialog box is used by the program. Note that
	the OK pushbutton is the only button spelled with all capital letters.<BR>
	<BR>
	
	<LI>Cancel: Used to close the dialog box and remove any changes that might have been
	performed while the dialog box was open. If there are changes that cannot be reversed,
	the label for this button should be changed to read Close. Changing the label for
	a button is discussed later in this hour.<BR>
	<BR>
	
	<LI>Close: Used to close the dialog box. It does not necessarily imply that any action
	is taken by the program. Close is most often used when a Cancel button cannot be
	used to remove changes made while the dialog box is open. Many programs change a
	Cancel button into a Close button.<BR>
	<BR>
	
	<LI>Help: Used to request context-sensitive help for the open dialog box.<BR>
	<BR>
	
	<LI>Apply: Used to perform changes based on data that has been entered in the dialog
	box. Unlike the OK button, the dialog box should remain open after the Apply button
	is pressed.
</UL>

<H2><FONT COLOR="#000077"><B>Binding a Button Control to a <TT>CButton</TT> Object</B></FONT></H2>
<P>The easiest way to set or retrieve the value of a control is to associate it with
a class-member variable using ClassWizard. When associating a member variable with
a control, you can associate the member variable either with the control or with
the control's value. Member variables representing buttons are rarely associated
by value; instead, the <TT>CButton</TT> class is used to represent most button controls.
You will learn about associating member variables by value with dialog box controls
in Hour 6, &quot;Using Edit Controls.&quot;</P>
<P>To add a member variable to a <TT>CDialog</TT>-derived class, follow these steps:

<DL>
	<DD>1. Open ClassWizard.<BR>
	<BR>
	2. Select the tab labeled Member Variables.<BR>
	<BR>
	3. Select the <TT>CDialog</TT>-derived class that manages the dialog box; in this
	case, <TT>CButtonDlg</TT>.<BR>
	<BR>
	4. Select the control ID representing the control associated with the new member
	variable.<BR>
	<BR>
	5. Press the button labeled Add Variable. An Add Member Variable dialog box appears.
	<BR>
	Enter the control's name, category, and variable type, then press OK.<BR>
	<BR>
	6. Close ClassWizard.
</DL>

<P>Follow these steps for all controls added to the <TT>IDD_BUTTON_DIALOG</TT> earlier.
Use the values from Table 5.2 for each new member variable added to <TT>CButtonDlg</TT>.
<H4><FONT COLOR="#000077">Table 5.2. Values used to add member variables for CButtonDlg.</FONT></H4>
<P>
<TABLE BORDER="1">
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT"><B>Control ID</B></TD>
		<TD ALIGN="LEFT"><B>Variable Name</B></TD>
		<TD ALIGN="LEFT"><B>Category</B></TD>
		<TD ALIGN="LEFT"><B>Type</B></TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT"><TT>IDC_BTN_TEST</TT></TD>
		<TD ALIGN="LEFT"><TT>m_btnTest</TT></TD>
		<TD ALIGN="LEFT">Control</TD>
		<TD ALIGN="LEFT"><TT>CButton</TT></TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT"><TT>IDC_GROUP_VOLUME</TT></TD>
		<TD ALIGN="LEFT"><TT>m_btnVolume</TT></TD>
		<TD ALIGN="LEFT">Control</TD>
		<TD ALIGN="LEFT"><TT>CButton</TT></TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT"><TT>IDC_CHECK_AMP</TT></TD>
		<TD ALIGN="LEFT"><TT>m_btnAmp</TT></TD>
		<TD ALIGN="LEFT">Control</TD>
		<TD ALIGN="LEFT"><TT>CButton</TT></TD>
	</TR>
</TABLE>
</P>
<P>ClassWizard automatically adds the member variables to the <TT>CButtonDlg</TT>
class declaration for you.
<H3><FONT COLOR="#000077"><B>Adding Button Events to a Dialog Box Class</B></FONT></H3>
<P>Although the buttons are part of the dialog box resource and appear whenever the

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区在线电影| 美女一区二区在线观看| 日韩亚洲欧美一区二区三区| 国产精品夜夜嗨| 日本伊人精品一区二区三区观看方式| 国产精品进线69影院| 欧美成人a∨高清免费观看| 色又黄又爽网站www久久| 国产成人av电影在线播放| 日本欧美一区二区三区| 亚洲精品乱码久久久久久| 亚洲国产精品精华液2区45| 日韩三级在线观看| 欧美日韩在线播| 91高清视频免费看| 风流少妇一区二区| 国产乱对白刺激视频不卡| 老司机精品视频一区二区三区| 亚洲成人自拍偷拍| 夜夜嗨av一区二区三区网页 | 久久久.com| 欧美一级二级在线观看| 欧美日韩另类一区| 在线观看日韩高清av| 色综合久久88色综合天天6| 成人av免费网站| 成人精品鲁一区一区二区| 国产一区二区三区黄视频 | 久99久精品视频免费观看| 日产国产高清一区二区三区| 亚洲va韩国va欧美va精品| 亚洲一区二区三区在线播放| 亚洲精选视频免费看| 最新欧美精品一区二区三区| 中文字幕亚洲区| 亚洲视频资源在线| 中文字幕人成不卡一区| 亚洲丝袜另类动漫二区| 一区二区三区精品在线观看| 亚洲精品国产成人久久av盗摄 | 日本免费新一区视频| 亚洲第一在线综合网站| 香蕉av福利精品导航| 肉丝袜脚交视频一区二区| 日韩**一区毛片| 美腿丝袜亚洲色图| 国产原创一区二区三区| 国产·精品毛片| 99国内精品久久| 在线观看成人小视频| 欧美日韩成人在线| 日韩欧美一二三| 久久免费看少妇高潮| 国产精品毛片大码女人| 亚洲一区二区三区激情| 免费观看日韩av| 成人一区二区三区视频| 色香蕉久久蜜桃| 91精品国产综合久久香蕉麻豆| 日韩欧美精品在线| 中文幕一区二区三区久久蜜桃| 国产精品久久久久一区二区三区| 亚洲激情图片一区| 秋霞av亚洲一区二区三| 国产精品一区2区| 99re在线精品| 欧美一区二区视频网站| 国产午夜精品久久久久久久| 亚洲精品videosex极品| 五月综合激情网| 国产另类ts人妖一区二区| 色综合天天性综合| 91精品免费在线观看| 欧美国产国产综合| 依依成人精品视频| 韩国av一区二区三区四区| 色综合欧美在线视频区| 日韩精品一区二区三区在线观看| 日本一二三四高清不卡| 五月天激情综合| 波多野结衣亚洲一区| 欧美精品久久一区| 国产亚洲美州欧州综合国| 一区二区三区自拍| 国产在线精品免费| 欧美日韩精品欧美日韩精品一 | 欧美无砖专区一中文字| 日韩美一区二区三区| 中文字幕综合网| 国产尤物一区二区在线| 欧美日韩国产片| 日韩一区在线播放| 激情图片小说一区| 欧美午夜精品一区| 国产精品福利一区二区三区| 卡一卡二国产精品| 色老头久久综合| 欧美国产日本视频| 精品一区二区三区欧美| 欧美性一区二区| 国产精品蜜臀在线观看| 久热成人在线视频| 欧美视频日韩视频| 中文字幕日本乱码精品影院| 国产一区二区在线影院| 911国产精品| 亚洲国产视频一区二区| av在线播放成人| 日本一区免费视频| 激情伊人五月天久久综合| 欧美图区在线视频| 亚洲精品日韩一| 91在线国产福利| 国产精品久久久久7777按摩| 国产一区二区日韩精品| 日韩免费一区二区三区在线播放| 亚洲伊人色欲综合网| 91免费看视频| 中文字幕亚洲成人| 国产成人av资源| 国产视频一区在线播放| 国产综合色精品一区二区三区| 日韩欧美你懂的| 免费观看日韩电影| 欧美一卡2卡3卡4卡| 婷婷国产在线综合| 欧美日本不卡视频| 日日夜夜免费精品| 6080国产精品一区二区| 亚洲第一主播视频| 欧美日韩国产乱码电影| 亚洲va欧美va人人爽| 欧美精品久久久久久久多人混战 | 国产福利精品导航| 久久嫩草精品久久久精品一| 国产资源精品在线观看| 精品国产乱码久久久久久老虎| 久久精品国产免费看久久精品| 日韩欧美久久一区| 国产在线观看一区二区| 国产午夜精品一区二区三区嫩草| 国产精品18久久久久久久久久久久| 久久久精品tv| 成人一区在线看| 亚洲欧美日韩精品久久久久| 在线观看网站黄不卡| 亚洲成av人影院在线观看网| 91精品久久久久久蜜臀| 精品一区二区三区在线观看国产 | 成人app在线| 亚洲激情在线播放| 欧美日韩国产影片| 国产又黄又大久久| 亚洲欧洲av色图| 欧美日韩一区二区电影| 同产精品九九九| 久久嫩草精品久久久精品| 不卡的av网站| 亚洲第四色夜色| 精品国产三级电影在线观看| 成人一区在线看| 亚洲成人av福利| 欧美精品一区二区三区在线播放| 成人黄色一级视频| 亚洲va欧美va人人爽| 久久这里只有精品视频网| 波多野结衣中文字幕一区| 亚洲成人中文在线| 国产亚洲精品资源在线26u| 色婷婷av一区二区三区之一色屋| 日韩和欧美一区二区三区| 国产偷国产偷精品高清尤物| 91福利社在线观看| 久久国产精品99久久久久久老狼| 国产精品免费久久| 91精品视频网| 成人av资源网站| 免费成人av在线播放| 国产精品欧美精品| 91精品国模一区二区三区| 成人丝袜视频网| 青娱乐精品视频在线| 亚洲三级视频在线观看| 欧美成人官网二区| 在线精品观看国产| 国产精品一卡二卡| 午夜精品久久久久久久久久久| 国产日韩欧美在线一区| 欧美精品乱码久久久久久| av中文字幕亚洲| 久久99热这里只有精品| 一区二区三区中文字幕| 久久久久97国产精华液好用吗| 欧美日韩一区二区三区四区五区| 国产精品99久久久久久久vr| 日韩高清中文字幕一区| 亚洲精品写真福利| 国产女人18水真多18精品一级做| 欧美日韩一级大片网址| 色综合天天综合网天天狠天天|