当前位置:首页
开发技术指南» 文章正文
    引言:

    摘要: 我换了块新硬盘,把原来的xp系统克隆了上去。 装好后,启动过程正常。 到了出现登陆窗口时,输入用户名、口令后,出现“正在登陆”。过了一会后,发现变成了“正在注销”,然后又返回登陆窗口。 启动后进入安全模式也是一样,用administrator和我自己的用户都是一样。 请教各位大虾,该如何解决啊? ......
 ·以这种样式来做    »显示摘要«
    摘要: --------------------- >(按钮) ----------------- move up(button) |checkbox 1 这边表格有初值 |-------------------- move down |checkbox 2 <(按钮) | | |---------- 这么画的能看懂吗? ......


为什么我在ATL的OnDraw中画不了线

代码是这样的  
  HRESULT   CGrid::OnDraw(ATL_DRAWINFO&   di)  
  {  
                    MoveToEx(di.hdcDraw,0,0,NULL);  
          LineTo(di.hdcDraw,100,100);    
                    return   S_OK;  
  }  
 

NO.1   作者: goodboyws

坐标问题是不是MM_HIENGLISH的坐标

NO.2   作者: jytan

同意楼上的,完全是坐标问题,线形画刷也可以不写,直接用默认的。建议看一下msdn里面的ATL教程,仿照那个OnDraw函数,一定能搞定。  
  ps:如果你用vs.net的调试器看是可以看到你画的线的。如果放到网页上,坐标变了,就可能看不到了。  
  下面是atl教程里面的ondraw函数。  
  HRESULT   CPolyCtl::OnDraw(ATL_DRAWINFO&   di)  
  {  
        RECT&   rc   =   *(RECT*)di.prcBounds;  
        HDC   hdc     =   di.hdcDraw;  
   
        COLORREF         colFore;  
        HBRUSH             hOldBrush,   hBrush;  
        HPEN                 hOldPen,   hPen;  
   
        //   Translate   m_colFore   into   a   COLORREF   type  
        OleTranslateColor(m_clrFillColor,   NULL,   &colFore);  
   
        //   Create   and   select   the   colors   to   draw   the   circle  
        hPen   =   (HPEN)GetStockObject(BLACK_PEN);  
        hOldPen   =   (HPEN)SelectObject(hdc,   hPen);  
        hBrush   =   (HBRUSH)GetStockObject(WHITE_BRUSH);  
        hOldBrush   =   (HBRUSH)SelectObject(hdc,   hBrush);  
   
        Ellipse(hdc,   rc.left,   rc.top,   rc.right,   rc.bottom);  
   
        //   Create   and   select   the   brush   that   will   be   used   to   fill   the   polygon  
        hBrush         =   CreateSolidBrush(colFore);  
        SelectObject(hdc,   hBrush);  
   
        CalcPoints(rc);  
        Polygon(hdc,   &m_arrPoint[0],   m_nSides);  
   
        //   Select   back   the   old   pen   and   brush   and   delete   the   brush   we   created  
        SelectObject(hdc,   hOldPen);  
        SelectObject(hdc,   hOldBrush);  
        DeleteObject(hBrush);  
   
        return   S_OK;  
  }  
 


    摘要: 我要统计一个表中sex字段男女的数目在sql中可以用select sum(id) from table1 where sex=男,但是这个sun(id)怎么才能出来呢?它只是在sql中啊,在delphi中我是不是只能多次打开adoquery添加sql语句来取得我要的数据? ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE