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] |