打印本文 打印本文 关闭窗口 关闭窗口
TFontNameComboBox及TFontSizeComboBox的实现
作者:武汉SEO闵涛  文章来源:敏韬网  点击数4809  更新时间:2009/4/23 18:38:22  文章录入:mintao  责任编辑:mintao
gt;Clear();
      Build();
    }  
}
//---------------------------------------------------------------------------
void __fastcall TFontSizeComboBox::Build()
{
  TNotifyEvent OnChangeEvent = OnChange;
  OnChange = NULL;
  HDC DC = GetDC(GetDesktopWindow());
  PixelsPerInch = GetDeviceCaps(DC, LOGPIXELSY);
  try
    {
      EnumFontFamilies(DC, FFontName.c_str(), (FONTENUMPROC)(EnumFontSizeProc),LPARAM(Items));
    }
  __finally
    {
      ReleaseDC(GetDesktopWindow(),DC);
    }
  OnChange = OnChangeEvent;
  if(Items->Count)
    ItemIndex = 0;
}
//---------------------------------------------------------------------------
namespace Fontcombobox
{
        void __fastcall PACKAGE Register()
        {
                 TComponentClass classes[2] = {__classid(TFontNameComboBox),
                                               __classid(TFontSizeComboBox)};
                 RegisterComponents("Samples", classes, 1);
        }
}
//---------------------------------------------------------------------------

上一页  [1] [2] [3] [4] [5] [6] 

打印本文 打印本文 关闭窗口 关闭窗口