stringgrid用左右方向键如何控制水平滚动条移动 如题,scrollbars: ssboth; rowselect选中的情况下,按左,右方向键时只能上下移动,怎么才能只移动水平滚动条? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 给你一段代码!unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids, StdCtrls;type TForm1 = class(TForm) StringGrid1: TStringGrid; Button1: TButton; procedure Button1Click(Sender: TObject); procedure StringGrid1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);var i,j : Integer;begin StringGrid1.RowCount := 100; StringGrid1.ColCount := 100; for i:=0 to StringGrid1.RowCount -1 do for j:=0 to StringGrid1.ColCount -1 do StringGrid1.Cells[i,j] := IntToStr(i*j);end;procedure TForm1.StringGrid1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin if Key = VK_LEFT then begin Sendmessage(StringGrid1.Handle, WM_HSCROLL, SB_PAGELEFT, 0); Key:=0; end; if Key= VK_RIGHT then begin Sendmessage(StringGrid1.Handle, WM_HSCROLL, SB_PAGERIGHT, 0); Key:=0; end;end;end. 条码类型不同显示结果也不同 如果给com对象传递对象参数? 求助,怎么使用 sql 脚本,谢谢! 怎么调试一个BPL组件? 带参数启动程序的问题!!!!!! 菜鸟提一简单问题var co:currency;定义变量 currency 代表什么意思 菜鸟提问重金回报 送分问题: 我打开了A表,对第一条记录(注意,是第一条记录)进行了修改,然后调用Post或Update,接着关闭该表,再打开它,重新读取,但刚才修改的 关于结束类名!高手前进! 关于三层的问题? 急急急dbgrid数据库数据自动更新
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, StdCtrls;type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure StringGrid1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
i,j : Integer;
begin
StringGrid1.RowCount := 100;
StringGrid1.ColCount := 100; for i:=0 to StringGrid1.RowCount -1 do
for j:=0 to StringGrid1.ColCount -1 do
StringGrid1.Cells[i,j] := IntToStr(i*j);
end;procedure TForm1.StringGrid1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_LEFT then
begin
Sendmessage(StringGrid1.Handle, WM_HSCROLL, SB_PAGELEFT, 0);
Key:=0;
end; if Key= VK_RIGHT then
begin
Sendmessage(StringGrid1.Handle, WM_HSCROLL, SB_PAGERIGHT, 0);
Key:=0;
end;
end;end.