我用VS.NET新建了一个win32项目,在初始化的时候调用InitCommonControls() 函数以便可以使用通用控件,之后我在窗体上创建了WC_TABCONTROL 控件,就是俗称的TabControl,但是默认的字体非常不好看,我想改变WC_TABCONTROL的字体,可以做到么?how can i change font and fontsize?

解决方案 »

  1.   

    Owner-Drawn Tabs
    If a tab control has the TCS_OWNERDRAWFIXED style, the parent window must paint tabs by processing the WM_DRAWITEM message. The tab control sends this message whenever a tab needs to be painted. The lParam parameter specifies the address of a DRAWITEMSTRUCT structure, which contains the index of the tab, its bounding rectangle, and the device context (DC) in which to draw. 
      

  2.   

    ming6424(大笨蛋100分)说的方法:
    1 给控件与一个TCS_OWNERDRAWFIXED style;
    2 处理WM_DRAWITEM 消息,这里你想干什么都行了 呵呵;
    不过单单要改变字体,估计这个控件的类应该有相应的函数 或许就是 gao_ming77(小明说的 setfont。