Kolor buttona

0

Jak zmienić kolor buttona albo nalozyć na niego jakąś bitmapę ? Przeglądałem właściwości buttona ale nie znalazłem tam koloru...

0

Uzyj bitbutton, próbuj wykorzystac kompinacje TPanel+TImage, poszukaj w necie TColorButton... mozliwości jest wiele

0

Do zmiany kolory butona :
SetClassLong(hWndButona, GCL_HBRBACKGROUND, nowy_kolor);
nowy_kolor to kazda wartosc ktora moglbys podac przy deklaracji klasy
w polu background.
Zeby wrzucic na butona jakis obrazek to musisz podpiac sie pod jego
procedure obslugi komunikatow - napisac podklase danej kontrolki.
W niej obsluzyc tylko WM_PAINT lub WM_ERASEBKGND - w nich namalowac obrazek,
a reszte komunikatow przeslac do starej procedury - return CallWindowProc( OldWndProc, hWnd, message, wParam, lParam);
Podmieniasz procedure za pomoca - SetWindowLong(hWndButtona, GWL_HWNDPROC, (WNDPROC)NewProc).
Mozesz tez zrobic calkowicie swoj button uzywajac stylu BS_OWNERDRAW i tworzac
odpowiednia procedurke go malujaca.

0

A po co podpinac procedurkę?

BM_SETIMAGE Message


An application sends a BM_SETIMAGE message to associate a new image (icon or bitmap) with the button.

Syntax

To send this message, call the SendMessage function as follows.
lResult = SendMessage( * returns LRESULT in lResult (HWND) hWndControl, * handle to destination control (UINT) BM_SETIMAGE, * message ID (WPARAM) wParam, * = (WPARAM) () wParam; (LPARAM) lParam // = (LPARAM) () lParam; );
Parameters

wParam
Specifies the type of image to associate with the button. This parameter can be one of the following values:
IMAGE_BITMAP
IMAGE_ICON
lParam
Handle to the image to associate with the button.
Return Value

The return value is a handle to the image previously associated with the button, if any; otherwise, it is NULL.

BM_GETIMAGE Message


An application sends a BM_GETIMAGE message to retrieve a handle to the image (icon or bitmap) associated with the button.

Syntax

To send this message, call the SendMessage function as follows.
lResult = SendMessage( * returns LRESULT in lResult (HWND) hWndControl, * handle to destination control (UINT) BM_GETIMAGE, * message ID (WPARAM) wParam, * = (WPARAM) () wParam; (LPARAM) lParam // = 0; not used, must be zero );
Parameters

wParam
Specifies the type of image to associate with the button. This parameter can be one of the following values:
IMAGE_BITMAP
IMAGE_ICON
lParam
This parameter is not used.
Return Value

The return value is a handle to the image, if any; otherwise, it is NULL.

0

ort!: "Speedbutton" Zmień na 'Speedbutton.flat := False;' i on przyjmie kolor formy lub czegoś co jest po ort! np. Image. Ma też opcje bitmapy ort! bitmapy. Naj ort! go <ort>używa</ort>!!!!! [browar]

0

Możesz użyć Speedbuttona i w Object Inspektorze \Propertis znajdz sobie zakładke "Glyph" kliknij ją i wybierz jakąś bitmape

1 użytkowników online, w tym zalogowanych: 0, gości: 1