if (Msg.hwnd = Form1.Handle) and (Msg.message = WM_LBUTTONDOWN) then
begin
SendMessage(RadioButton2.Handle, WM_PAINT, 0,0);
Handled := true
end;
if (Msg.hwnd = RadioButton2.Handle) then
begin
case Msg.message of
WM_PAINT:
begin
...
end;
end
end
var
DC: HDC;
PS: TPaintStruct;
begin
Handled := false;
if (Msg.hwnd = RadioButton1.Handle) then
case Msg.message of
WM_PAINT:
begin
DC := BeginPaint(Msg.hwnd, PS);
...
EndPaint(Msg.hwnd, PS);
Handled := true
end;
end
end;
type
TForm1 = class(TForm)
private
procedure WMMove(var Msg: TWMMove); message WM_MOVE;
end;
procedure TForm1.WMMove(var Msg: TWMMove);
var
Mes: tagMSG;
Handled: Boolean;
begin
inherited;
Mes.hwnd := hRB[1];
Mes.message := WM_PAINT;
Mes.wParam := 0;
Mes.lParam := 0;
Form1.AppMessage(Mes, Handled);
Mes.hwnd := hRB[2];
Form1.AppMessage(Mes, Handled);
Mes.hwnd := hRB[3];
Form1.AppMessage(Mes, Handled)
end;
--------------------------------------
где hRb[1] - hRB[3] -- хендлы 3-х RadioButton'ов; AppMessage -- обработчик сообщений (Application.OnMessage := AppMessage)
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 2