CControlBar::SetBorders
 
void SetBorder( int cxLeft, int cyTop, int cxRight, int cyBottom );
void SetBorder( LPCRECT lpRect );
 
参数: cxLeft 控件条左边界的宽度(以像素为单位)。  
cyTop 控件条上边界的高度。  
cxRight 控件条右边界的宽度。  
cyBottom 控件条下边界的高度。  
lpRect CRect对象的指针。该对象中记录了控件条对象每边的宽度(以像素为单位)。  
 
说明:
本函数用于设置控件条边界的大小。例如,下面的例子把控件条的上边框和下边框分别设为5个像素点,把左边框和右边框设为2个像素点。
m_myControlBar.SetBorders(2, 5, 2, 5);
 
关于这一段代码我想提两个小问题:
1.setborder这个函数的参数是以像素为单位,那么一个像素到底是多大呢?如果说单位是厘米,那我心中有一个概念可以很好的设置这些参数的宽度和高度,但是像素完全没有概念,如下面例子的使用2个像素点到底是多大? 这些是不是只能在我们编程的过程当中自己去试?
2.我一直搞不懂,这个控件上面界的高度到底指的是什么高度,控件条的高度?还是控件条到窗口的高度?如例子,我的CYTOP为2,也就是控件条上面界的高度为2个像素。这个高度到底是什么样的一个概念。 谢谢!setbordertoolbar

解决方案 »

  1.   

    像素就是 一个点,这个点 没大小, 与屏幕的分辨率有关。
    分辨率高 就是 单位长度内(每英寸,每厘米) 的 点(像素) 多。
    MM_TEXT 就是 以像素为单位,还有其他的 MM_Borders 就是 边, 2就是 边框的 厚度。
      

  2.   

    查函数:SetMapMode :
    MM_ANISOTROPIC Logical units are mapped to arbitrary units with arbitrarily scaled axes. Use the SetWindowExtEx and SetViewportExtEx functions to specify the units, orientation, and scaling.  
    MM_HIENGLISH Each logical unit is mapped to 0.001 inch. Positive x is to the right; positive y is up. 
    MM_HIMETRIC Each logical unit is mapped to 0.01 millimeter. Positive x is to the right; positive y is up. 
    MM_ISOTROPIC Logical units are mapped to arbitrary units with equally scaled axes; that is, one unit along the x-axis is equal to one unit along the y-axis. Use the SetWindowExtEx and SetViewportExtEx functions to specify the units and the orientation of the axes. Graphics device interface (GDI) makes adjustments as necessary to ensure the x and y units remain the same size (When the window extent is set, the viewport will be adjusted to keep the units isotropic). 
    MM_LOENGLISH Each logical unit is mapped to 0.01 inch. Positive x is to the right; positive y is up. 
    MM_LOMETRIC Each logical unit is mapped to 0.1 millimeter. Positive x is to the right; positive y is up. 
    MM_TEXT Each logical unit is mapped to one device pixel. Positive x is to the right; positive y is down. 
    MM_TWIPS Each logical unit is mapped to one twentieth of a printer's point (1/1440 inch, also called a "twip"). Positive x is to the right; positive y is up.