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

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

?? ch10.htm

?? Learning language of Visual C++6
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
<SCRIPT LANGUAGE="JavaScript">

<!--

function popUp(pPage) {
 var fullURL = document.location;
 var textURL = fullURL.toString();
 var URLlen = textURL.length;
 var lenMinusPage = textURL.lastIndexOf("/");
 lenMinusPage += 1;
 var fullPath = textURL.substring(0,lenMinusPage);
 popUpWin = window.open('','popWin','resizable=yes,scrollbars=no,width=525,height=394');
 figDoc= popUpWin.document;
 zhtm= '<HTML><HEAD><TITLE>' + pPage + '</TITLE>';
 zhtm += '<link rel="stylesheet" href="/includes/stylesheets/ebooks.css"></head>';
 zhtm += '<BODY bgcolor="#FFFFFF">';
 zhtm += '<IMG SRC="' + fullPath + pPage + '">';
 zhtm += '<P><B>' + pPage + '</B>';
 zhtm += '</BODY></HTML>';
 window.popUpWin.document.write(zhtm);
 window.popUpWin.document.close();
 // Johnny Jackson 4/28/98
 }

//-->
                                                                
</SCRIPT>
<link rel="stylesheet" href="/includes/stylesheets/ebooks.css">

	
	<TITLE>Special Edition Using Visual C++ 6 -- Ch 10 -- Common Controls</TITLE>
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#FFFFFF">

<CENTER>
<H1><IMG SRC="../button/que.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"><BR>
Special Edition Using Visual C++ 6</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"><IMG
SRC="../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>- 10 -</H1>

<H1>Common Controls</H1>
</CENTER>

<UL>
	<LI><A HREF="#Heading1">The Progress Bar Control</A>
	<UL>
		<LI><A HREF="#Heading2">Creating the Progress Bar</A>
		<LI><A HREF="#Heading3">Initializing the Progress Bar</A>
		<LI><A HREF="#Heading4">Manipulating the Progress Bar</A>
	</UL>
	<LI><A HREF="#Heading5">The Slider Control</A>
	<UL>
		<LI><A HREF="#Heading6">Creating the Trackbar</A>
		<LI><A HREF="#Heading7">Initializing the Trackbar</A>
		<LI><A HREF="#Heading8">Manipulating the Slider</A>
	</UL>
	<LI><A HREF="#Heading9">The Up-Down Control</A>
	<UL>
		<LI><A HREF="#Heading10">Creating the Up-Down Control</A>
	</UL>
	<LI><A HREF="#Heading11">The Image List Control</A>
	<UL>
		<LI><A HREF="#Heading12">Creating the Image List</A>
		<LI><A HREF="#Heading13">Initializing the Image List</A>
	</UL>
	<LI><A HREF="#Heading14">The List View Control</A>
	<UL>
		<LI><A HREF="#Heading15">Creating the List View</A>
		<LI><A HREF="#Heading16">Creating the List View's Columns</A>
		<LI><A HREF="#Heading17">Creating the List View's Items</A>
		<LI><A HREF="#Heading18">Manipulating the List View</A>
	</UL>
	<LI><A HREF="#Heading19">The Tree View Control</A>
	<UL>
		<LI><A HREF="#Heading20">Creating the Tree View</A>
		<LI><A HREF="#Heading21">Creating the Tree View's Items</A>
		<LI><A HREF="#Heading22">Manipulating the Tree View</A>
	</UL>
	<LI><A HREF="#Heading23">The Rich Edit Control</A>
	<UL>
		<LI><A HREF="#Heading24">Creating the Rich Edit Control</A>
		<LI><A HREF="#Heading25">Initializing the Rich Edit Control</A>
		<LI><A HREF="#Heading26">Manipulating the Rich Edit Control</A>
	</UL>
	<LI><A HREF="#Heading27">IP Address Control</A>
	<LI><A HREF="#Heading28">The Date Picker Control</A>
	<LI><A HREF="#Heading29">Month Calendar Control</A>
	<LI><A HREF="#Heading30">Scrolling the View</A>
</UL>

<P>
<HR SIZE="4">

<CENTER>
<H1></H1>
</CENTER>
<P>As a Windows user, you're accustomed to seeing controls such as buttons, list
boxes, menus, and edit boxes. As Windows developed, however, Microsoft noticed that
developers routinely create other types of controls in their programs: toolbars,
status bars, progress bars, tree views, and others. To make life easier for Windows
programmers, Microsoft included these popular controls as part of the operating environment
of Windows 95 (as well as later versions of Windows NT and then Windows 98). Now
Windows programmers no longer need to create from scratch their own versions of these
controls. This chapter introduces you to many of the 32-bit Windows common controls.
The toolbar and status bar controls are covered in Chapter 9, &quot;Status Bars and
Toolbars,&quot; and property sheets are covered in Chapter 12, &quot;Property Pages
and Sheets.&quot;</P>
<P>This chapter's sample program is called Common. It demonstrates nine of the Windows
95 common controls: the progress bar, slider, up-down, list view, tree view, rich
edit, IP address, date picker, and month calendar controls, all of which are shown
in Figure 10.1. In the following sections, you learn the basics of creating and using
these controls in your own applications.</P>
<P><A HREF="javascript:popUp('10uvc01.gif')"><B>FIG. 10.1</B></A><B> </B><I>The Common
sample application demonstrates nine Windows 95 common controls.</I></P>

<P>To make Common, create a new project with AppWizard and name it <B>Common</B>.
Choose a single-document interface (SDI) application in Step 1 and accept all the
defaults until Step 6. Drop down the Base Class box and choose CScrollView from the
list. This ensures that users can see all the controls in the view, even if they
have to scroll to do so. Click Finish and then OK to complete the process.</P>
<P>The controls themselves are declared as data members of the view class. Double-click
CCommonView in ClassView to edit the header file and add the lines in Listing 10.1
in the Attributes section. As you can see, the progress bar is an object of the CProgressCtrl
class. It's discussed in the next section, and the other controls are discussed in
later sections of this chapter.</P>
<P>
<H4>Listing 10.1&#160;&#160;CommonView.h--Declaring the Controls</H4>
<PRE>protected:
   //Progress Bar
    CProgressCtrl m_progressBar;
   //Trackbar or Slider
    CSliderCtrl m_trackbar;
    BOOL m_timer;
   // Up-Down or Spinner
    CSpinButtonCtrl m_upDown;
    CEdit m_buddyEdit;
   // List View
    CListCtrl m_listView;
    CImageList m_smallImageList;
    CImageList m_largeImageList;
    CButton m_smallButton;
    CButton m_largeButton;
    CButton m_listButton;
    CButton m_reportButton;
   // Tree View
    CTreeCtrl m_treeView;
    CImageList m_treeImageList;
   // Rich Edit
    CRichEditCtrl m_richEdit;
    CButton m_boldButton;
    CButton m_leftButton;
    CButton m_centerButton;
    CButton m_rightButton;
   // IP Address
   CIPAddressCtrl m_ipaddress;
   // Date Picker
   CDateTimeCtrl m_date;
   // Month Calendar
</PRE>
<PRE>   CMonthCalCtrl m_month;
</PRE>
<P>Expand the CCommonView class. Double-click CCommonView::OnDraw() in ClassView
and replace the TODO comment with these lines:</P>
<P>
<PRE>pDC-&gt;TextOut(20, 22, &quot;Progress Bar Control&quot;);
pDC-&gt;TextOut(270, 22, &quot;Trackbar Control:&quot;);
pDC-&gt;TextOut(20, 102, &quot;Up-Down Control&quot;);
pDC-&gt;TextOut(160, 102, &quot;List View Control&quot;);
pDC-&gt;TextOut(20, 240, &quot;Tree View Control&quot;);
pDC-&gt;TextOut(180, 240, &quot;Rich Edit Control&quot;);
pDC-&gt;TextOut(470, 22, &quot;IP Address Control&quot;);
pDC-&gt;TextOut(470, 102, &quot;Date Picker Control&quot;);
pDC-&gt;TextOut(470, 240, &quot;Month Calendar Control&quot;);
</PRE>
<P>These label the controls that you will add to CCommonView in this chapter.</P>
<P>
<H2><A NAME="Heading1"></A>The Progress Bar Control</H2>
<P>The common control that's probably easiest to use is the progress bar, which is
nothing more than a rectangle that slowly fills in with colored blocks. The more
colored blocks that are filled in, the closer the task is to being complete. When
the progress bar is completely filled in, the task associated with the progress bar
is also complete. You might use a progress bar to show the status of a sorting operation
or to give the user visual feedback about a large file that's being loaded.</P>
<P>
<H3><A NAME="Heading2"></A>Creating the Progress Bar</H3>
<P>Before you can use a progress bar, you must create it. Often in an MFC program,
the controls are created as part of a dialog box. However, Common displays its controls
in the application's main window, the view of this single-document interface (SDI)
application. Documents and views are introduced in Chapter 4, &quot;Documents and
Views.&quot; All the controls are created in the view class OnCreate() function,
which responds to the WM_CREATE Windows message. To set up this function, right-click
CCommonView in ClassView and choose Add Windows Message Handler. Choose WM_CREATE
from the list on the left and click Add and Edit. Add this line in place of the TODO
comment:</P>
<P>
<PRE>CreateProgressBar();
</PRE>
<P>Right-click CCommonView in ClassView again and this time choose Add Member Function.
Enter <B>void</B> for the Function Type and enter <B>CreateProgressBar()</B> for
the Function Declaration. Leave the access as Public. Click OK to add the function;
then add the code in Listing 10.2.</P>
<P>
<H4>Listing 10.2&#160;&#160;CommonView.cpp--CCommonView::CreateProgressBar()</H4>
<PRE>void CCommonView::CreateProgressBar()
{
    m_progressBar.Create(WS_CHILD | WS_VISIBLE | WS_BORDER,
        CRect(20, 40, 250, 80), this, IDC_PROGRESSBAR);
    m_progressBar.SetRange(1, 100);
    m_progressBar.SetStep(10);
    m_progressBar.SetPos(50);
    m_timer = FALSE;
</PRE>
<PRE>}
</PRE>
<P>CreateProgressBar() first creates the progress bar control by calling the control's
Create() function. This function's four arguments are the control's style flags,
the control's size (as a CRect object), a pointer to the control's parent window,
and the control's ID. The resource ID, IDC_PROGRESSBAR, is added by hand. To add
resource symbols to your own applications, choose View, Resource Symbols and click
the New button. Type in a resource ID Name, such as IDC_PROGRESSBAR, and accept the
default Value Visual Studio provides.</P>
<P>The style constants are the same constants that you use for creating any type
of window (a control is nothing more than a special kind of window, after all). In
this case, you need at least the following:</P>
<P>

<UL>
	<LI>WS_CHILD&#160;&#160;Indicates that the control is a child window
	<P>
	<LI>WS_VISIBLE&#160;&#160;Ensures that the user can see the control
</UL>

<P>The WS_BORDER is a nice addition because it adds a dark border around the control,
setting it off from the rest of the window.</P>
<P>
<H3><A NAME="Heading3"></A>Initializing the Progress Bar</H3>
<P>To initialize the control, CCommonView::CreateProgressBar() calls SetRange(),
SetStep(), and SetPos(). Because the range and the step rate are related, a control
with a range of 1-10 and a step rate of 1 works almost identically to a control with
a range of 1-100 and a step rate of 10.</P>
<P>When this sample application starts, the progress bar is already half filled with
colored blocks. (This is purely for aesthetic reasons. Usually a progress bar begins
its life empty.) It's half full because CreateProgressBar() calls SetPos() with the
value of 50, which is the midpoint of the control's range.</P>
<P>
<H3><A NAME="Heading4"></A>Manipulating the Progress Bar</H3>
<P>Normally you update a progress bar as a long task moves toward completion. In
this sample, you will fake it by using a timer. When the user clicks in the background
of the view, start a timer that generates WM_TIMER messages periodically. Catch these
messages and advance the progress bar. Here's what to do:</P>
<P>

<DL>
	<DT></DT>
	<DD><B>1. </B>Open ClassWizard. Make sure that CCommonView is selected in the upper-right
	drop- down box.
	<P>
	<DT></DT>
	<DD><B>2. </B>Scroll most of the way through the list box on the right until you
	find WM_LBUTTONDOWN, the message generated when the user clicks on the view. Select
	it.
	<P>
	<DT></DT>
	<DD><B>3. </B>Click Add Function; then click Edit Code.
	<P>
	<DT></DT>
	<DD><B>4. </B>Edit OnLButtonDown() so that it looks like this:
	<P>
</DL>

<PRE>void CCommonView::OnLButtonDown(UINT nFlags, CPoint point) 
{
   if (m_timer)
   {
      KillTimer(1);
      m_timer = FALSE;
   }
   else

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
五月婷婷综合网| 99久久久久免费精品国产 | 一区二区三区在线播放| 性做久久久久久免费观看| 国产综合色精品一区二区三区| 色悠悠亚洲一区二区| 26uuu成人网一区二区三区| 亚洲免费在线看| 看电影不卡的网站| 日本道色综合久久| 性做久久久久久| 国产精品1024| 日韩一区二区中文字幕| 亚洲区小说区图片区qvod| 精品一区二区三区影院在线午夜 | 一级特黄大欧美久久久| 国产精品资源网站| 欧美一区二区播放| 亚洲bt欧美bt精品| 色av一区二区| 中文字幕日韩一区二区| 国产成人鲁色资源国产91色综| 欧美亚洲综合另类| 亚洲精品日韩一| 国产成人aaaa| 久久久久久夜精品精品免费| 日韩avvvv在线播放| 欧美三日本三级三级在线播放| 最新中文字幕一区二区三区| 国产99久久久国产精品潘金网站| 777午夜精品视频在线播放| 亚洲一区二区三区在线| 色综合久久66| 亚洲欧美一区二区三区孕妇| 成人一道本在线| 亚洲国产高清aⅴ视频| 国产精品1区2区3区| 久久久久国产免费免费| 精品一二三四区| 久久影院午夜片一区| 国内精品视频一区二区三区八戒| 欧美大片一区二区| 国产中文字幕一区| 国产欧美日韩麻豆91| 粉嫩蜜臀av国产精品网站| 国产视频视频一区| 成人自拍视频在线| 最新成人av在线| 在线亚洲高清视频| 五月天激情综合| 欧美一区二区精品久久911| 免费久久99精品国产| 久久蜜臀中文字幕| fc2成人免费人成在线观看播放| 亚洲免费在线观看视频| 欧美视频日韩视频在线观看| 日韩精品亚洲专区| 337p日本欧洲亚洲大胆色噜噜| 国产高清一区日本| 亚洲视频你懂的| 911国产精品| 国产成人免费av在线| 亚洲激情校园春色| 欧美一区二区三区在线观看 | 天天影视色香欲综合网老头| 日韩免费观看2025年上映的电影| 国产精品亚洲一区二区三区妖精| 中文子幕无线码一区tr| 欧美三级电影网| 国产一区二区免费看| 555夜色666亚洲国产免| 国产九色sp调教91| 亚洲免费看黄网站| 欧美xxxxxxxx| 91麻豆免费在线观看| 青青草原综合久久大伊人精品| 久久久国产精华| 欧美综合亚洲图片综合区| 蜜臀久久99精品久久久画质超高清| 久久久国产精品午夜一区ai换脸| 欧美在线你懂得| 国产成人av一区| 日韩vs国产vs欧美| 中文字幕一区二区三区不卡| 日韩欧美久久一区| 欧美在线制服丝袜| 国产福利精品一区二区| 午夜久久久久久| 国产精品午夜在线观看| 欧美一二三四区在线| 日本韩国精品一区二区在线观看| 精品一区二区三区在线播放视频| 亚洲午夜久久久久久久久久久| 欧美国产视频在线| 精品国产免费久久| 欧美二区在线观看| 色婷婷久久久亚洲一区二区三区 | 日本欧美在线观看| 亚洲女与黑人做爰| 国产欧美精品区一区二区三区| 欧美一区2区视频在线观看| 99久久综合国产精品| 国产一级精品在线| 蜜桃av噜噜一区二区三区小说| 亚洲中国最大av网站| 亚洲人123区| 中文字幕成人av| 久久色中文字幕| 欧美成人精品1314www| 欧美丰满少妇xxxxx高潮对白| 91激情在线视频| 成人av在线网| 成人免费视频网站在线观看| 国产九九视频一区二区三区| 国产美女久久久久| 国内精品久久久久影院色| 久久精品国产免费看久久精品| 五月天一区二区三区| 午夜在线电影亚洲一区| 亚洲一级片在线观看| 亚洲一区二区在线免费观看视频 | 日本一区二区三区免费乱视频| 日韩精品在线一区| 欧美成人乱码一区二区三区| 欧美大片顶级少妇| 久久精品一区八戒影视| 精品国产sm最大网站免费看| 欧美精品一区二区三区视频| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 欧洲色大大久久| 欧美日韩国产乱码电影| 中文字幕一区二区视频| 国产精品女人毛片| 一区二区三区四区视频精品免费| 亚洲女同女同女同女同女同69| 亚洲激情在线播放| 亚洲va中文字幕| 久色婷婷小香蕉久久| 国产精品自拍网站| av电影天堂一区二区在线观看| 色综合天天视频在线观看| 欧美日韩成人在线一区| 欧美成人高清电影在线| 国产区在线观看成人精品| 国产精品人人做人人爽人人添| 亚洲三级视频在线观看| 午夜电影网一区| 极品少妇xxxx精品少妇偷拍| 成人av免费网站| 欧美日韩中文另类| 久久久久国产精品麻豆ai换脸 | 日韩免费观看高清完整版 | 国产女人aaa级久久久级 | 久久美女高清视频| 136国产福利精品导航| 天堂va蜜桃一区二区三区漫画版| 精品一区二区三区在线播放视频| 成人av资源站| 欧美一区二区成人6969| 国产精品护士白丝一区av| 亚洲成av人影院| 懂色av一区二区三区蜜臀| 欧美日韩一区 二区 三区 久久精品| 日韩欧美成人激情| 亚洲欧美另类久久久精品2019| 蜜臀精品久久久久久蜜臀| 99国产精品久久久久久久久久| 欧美一卡二卡三卡四卡| 最新中文字幕一区二区三区| 美女在线观看视频一区二区| 色国产精品一区在线观看| 久久久精品综合| 日韩精品成人一区二区三区| av在线综合网| 久久一区二区三区四区| 亚洲成av人在线观看| www.在线成人| xf在线a精品一区二区视频网站| 一个色综合网站| 成人网男人的天堂| 久久九九99视频| 美女在线一区二区| 欧美日本国产视频| 亚洲精品老司机| jlzzjlzz国产精品久久| 精品不卡在线视频| 美腿丝袜在线亚洲一区| 欧美性videosxxxxx| 亚洲免费观看视频| 成人黄色综合网站| 久久久久88色偷偷免费| 加勒比av一区二区| 日韩精品资源二区在线| 日本女人一区二区三区| 欧美三级日韩在线| 亚洲午夜国产一区99re久久| 91麻豆视频网站| 亚洲丝袜制服诱惑| 91在线云播放| 综合激情网...|