所有相关控件共用一OnEnter事件处理程序,在内写代码好像也不算麻烦啊
解决方案 »
- BusinessSkinForm的bsSkinMainMenu如何动态增加菜单?
- fastReport 主项 细项 的 设置问题 ???
- 希望哪位说说面向对象编程(数据库的)。在线等,每人有分。(2)
- 怎么样得到局域网中的计算机名或ip。请高手
- 求急,在线等待!!!如何实现启动窗口和登陆窗口的一步步显示??
- 数据库备份
- 程序员们!辛苦了一年,新年快乐哟!!!!
- 紧急问题:毕业设计delphi 下的c/s平台应该怎么搭建啊!内详!!!!!!!!100分!!!!
- 简单一问:我做的纯文本的编辑器(用的memo控件)中无法使用del键删除字符,何解?
- 如何实现该报表?
- 帮我看看该怎么计算啊?在线等 待
- 初级问题:谁能叙述一下建立自定义过程的步骤,都应该在哪里写代码?
var
iCount : Integer;
begin
for iCount := 0 to ComponentCount - 1 do
begin
if Components[iCount].Tag = 1 then
begin
TEdit(Components[iCount]).OnEnter := Edit1Enter;
end;
end;
end;procedure TForm1.Edit1Enter(Sender: TObject);
begin
Tedit(Sender).Font.Color := clRed;
end;
procedure TForm1.Edit1Enter(Sender: TObject);
begin
(Sender As TEdit).Color:=clRed;
(Sender As TEdit).Font.Color := clBlue;
endprocedure TForm1.Edit1Exit();
begin
(Sender As TEdit).Color:=clWhite;
(Sender As TEdit).Font.Color := clBlack;
end;
begin
Edit1.Color := clRed;
end;
懒一点就要做控件
hwndLoseFocus = (HWND) wParam; // handle of window losing focus
ParametershwndLoseFocusValue of wParam. Identifies the window that has lost the keyboard focus (may be NULL). Return ValuesAn application should return zero if it processes this message. ResTo display a caret, an application should call the appropriate caret functions when it receives the WM_SETFOCUS message.
hwndGetFocus = (HWND) wParam; // handle of window receiving focus
ParametershwndGetFocusValue of wParam. Identifies the window that receives the keyboard focus (may be NULL). Return ValuesAn application should return zero if it processes this message. ResIf an application is displaying a caret, the caret should be destroyed at this point.
你仔细想想,应该可以实现你所要的功能。