windowsun statik kontrolleri işimi görebilecek düzeyde ama bir türlü statik kontrolün stilini image olarak ayarlayamadım.
bu konu hakkında bilgisi olan arkadaşlar yardım ederse çok sevinirim.
bu kod label nesnesi gibi handle 'ı olan bir statik kontol oluşturuyor.
Kod: Tümünü seç
Button1.click
var
icon:hicon;
cs:TCreateStruct;
mWnd:Longword;
begin
mWnd := CreateWindowEx(WS_EX_STATICEDGE Or WS_EX_TRANSPARENT, 'STATIC', 'statik kontrol', WS_CHILD , 0, 0, 300, 50, Handle, 0, Application.Handle, @CS);
caption :=inttostr(mWnd);
ShowWindow( mWnd, SW_NORMAL);
nasıl yaptığını tam olarak anlayamadım
Kod: Tümünü seç
CStatic myStatic;
// Create a child icon static control.
myStatic.Create(_T("my static"),
WS_CHILD|WS_VISIBLE|SS_ICON|SS_CENTERIMAGE, CRect(10,10,150,50),
pParentWnd);
// Set the icon of the static control to be the system
// question mark icon.
myStatic.SetIcon( ::LoadIcon(NULL, IDI_QUESTION) );
...
SS_ICON : Specifies an icon is to be displayed in the dialog box. If the control is created as part of a dialog box, the text is the name of an icon (not a filename) defined elsewhere in the resource file. If the control is created via CreateWindow or a related function, the text is the name of an icon (not a filename) defined in the resource file associated with the module specified by the hInstance parameter to CreateWindow. The icon can be an animated cursor. The style ignores the nWidth and nHeight parameters; the control automatically sizes itself to accommodate the icon.
...