觀點中國 CnEyes...
只有想不到的.没有做不到的! For Evreth ing Making For Anything 才子世界 Esprit World!
posts - 80,comments - 83,trackbacks - 0

1、为DBNavigator1控件加上Caption

procedure TForm1.FormCreate(Sender: TObject);
var
  I: Integer;
begin
  TNavButton(Components[I]).Layout :=blGlyphTop;
  with DBNavigator1 do for I := 0 to ComponentCount - 1 do
    if Components[I] is TNavButton then begin
      case TNavButton(Components[I]).Index of
        nbFirst: TNavButton(Components[I]).Caption := '首笔';
        nbPrior: TNavButton(Components[I]).Caption := '上笔';
        nbNext: TNavButton(Components[I]).Caption := '下笔';
        nbLast: TNavButton(Components[I]).Caption := '末笔';
        nbInsert: TNavButton(Components[I]).Caption := '新增';
        nbDelete: TNavButton(Components[I]).Caption := '删除';
        nbEdit: TNavButton(Components[I]).Caption := '修改';
        nbPost: TNavButton(Components[I]).Caption := '存档';
        nbCancel: TNavButton(Components[I]).Caption := '取消';
        nbRefresh: TNavButton(Components[I]).Caption := '刷新';
      end;
    end;
end;
 

 

2、限制Mouse的活动范围

procedure TForm1.Button1Click(Sender: TObject);
var
btButton2: TRect;
begin
btButton2 := button2.BoundsRect; // 限制在Button2的范围
MapWindowPoints(handle, 0, btButton2, 2); // 座标换算
ClipCursor(@btButton2); // 限制鼠标移动区域
end;

 

// 还原
procedure TForm1.Button2Click(Sender: TObject);
var
btScreen: TRect;
begin
btScreen := Rect(0, 0, Screen.Width, Screen.Height);
ClipCursor(@btScreen);
end;

posted on 2006-06-11 17:14 才子£鸣 阅读(272) 评论(0)  编辑 收藏 引用
只有注册用户登录后才能发表评论。