久久―日本道色综合久久,亚洲欧美精品在线,狼狼色丁香久久婷婷综合五月,香蕉人人超,日本网站黄,国产在线观看不卡免费高清,无遮挡的毛片免费

2025年度未來(lái)銀行科技服務(wù)商TOP100
全世界各行各業(yè)聯(lián)合起來(lái),internet一定要實(shí)現(xiàn)!

VC中設(shè)計(jì)在窗體中加入3D Bar

2004-02-23 eNet&Ciweek

源碼


  這個(gè)類(lèi)的使用方法很簡(jiǎn)單,3DBbar中一共有7個(gè)public函數(shù)。分別為:

void SetBarColour(COLORREF cr);
void DrawHorizontal(CDC* pDC, CRect& BarRect); //畫(huà)水平bar
void DrawVertical(CDC*pDC,CRect& BarRect); //畫(huà)垂直bar
void DrawLeft(CDC*pDC,CRectleftRect); //畫(huà)左邊bar
void DrawRight(CDC*pDC,CRectrightRect); //畫(huà)右邊bar
void DrawTop(CDC*pDC,CRect&topRect); //畫(huà)頂邊bar
void DrawBottom(CDC*pDC,CRect&bottomRect); //畫(huà)底邊bar
  從以上我們也可以看到,其實(shí)我們?cè)谟玫臅r(shí)候一般用的是SetBarColour(COLORREF cr)、 DrawLeft、DrawRight、DrawTop和DrawBottom這5個(gè)函數(shù),用法也很簡(jiǎn)單。如:我們?cè)谝粋€(gè)自定義的Static CDigiStatic中使用??梢苑譃橐韵聨撞剑?

  1、首先把3DBar.h 和3DBar.cpp 加入到你的工程中。
  2、在你使用的類(lèi)中加入頭文件,#include "3dbar.h"
  3、申明一個(gè)C3DBar對(duì)象。C3DBar Bar;
  4、在類(lèi)的初始化中調(diào)用Bar的函數(shù):SetBarColour;
  5、在你使用的類(lèi)的OnPaint();函數(shù)中調(diào)用前面介紹的4個(gè)函數(shù)就可以了。
例如: void CDigiStatic::OnPaint()
{
CRect dlgrect;
GetClientRect(dlgrect);

CRect rectleft(0,0,dlgrect.Width()/30,dlgrect.bottom),\
rectright(dlgrect.right-dlgrect.Width()/30,0,dlgrect.right,dlgrect.bottom),\
recttop(0,0,dlgrect.right,dlgrect.Width()/30),\
rectbottom(0,dlgrect.bottom-dlgrect.Width()/30,dlgrect.right,dlgrect.bottom);

CPaintDC dc(this); // device context for painting

Bar.DrawLeft(&dc,rectleft);
Bar.DrawTop(&dc,recttop);
Bar.DrawBottom(&dc,rectbottom);
Bar.DrawRight(&dc,rectright);
}

相關(guān)頻道: eNews

您對(duì)本文或本站有任何意見(jiàn),請(qǐng)?jiān)谙路教峤?,謝謝!

投稿信箱:tougao@enet16.com