📄 mainform.pas
字号:
0: begin
for i:= 1 to 33 do
tc.Series[0].Add(adata[i],inttostr(i),clred) ;
end;
1: begin
for i:= 1 to 16 do
tc.Series[0].Add(atb[i],inttostr(i),clblue);
end;
2 : begin
for i:= 1 to 33 do
tc.Series[0].Add(adata[i],inttostr(i),clred) ;
for i:= 1 to 16 do
tc.Series[0].Add(atb[i],inttostr(i),clblue);
end;
3:begin
for i:= 1 to 32 do
tc.Series[0].Add(adata[i],'[' + inttostr(i) + ',' + inttostr(i+1) + ']',clred) ;
end;
4:begin
for i:= 1 to 31 do
tc.Series[0].Add(adata[i],'[' + inttostr(i) + ',' + inttostr(i+1) + ',' +inttostr(i+2) + ']',clred) ;
end;
5:begin
for i:= 1 to 30 do
tc.Series[0].Add(adata[i],'[' + inttostr(i) + ',' + inttostr(i+1) + ',' +inttostr(i+2) + ',' + inttostr(i+3) + ']',clred) ;
end;
6:begin
for I:= 1 to 31 do
tc.Series[0].Add(adata[i],'[' + inttostr(i) + ',' + inttostr(i+2) + ']',clred) ;
end;
7:begin
for i:= 1 to 29 do
tc.Series[0].Add(adata[i],'[' + inttostr(i) + ',' + inttostr(i+2) + ',' +inttostr(i+4) + ']',clred) ;
end
end;
tc.Series[0].Title :='双色球号码分析 [' + fqfw.text + '-' + tbfs.text + ']';
end;
procedure TfrmMainForm.TBFSChange(Sender: TObject);
begin
totaldata;
setvalue(tc);
end;
procedure TfrmMainForm.tcDblClick(Sender: TObject);
begin
frmzs := Tfrmzs.Create(application);
frmzs.ShowModal;
frmzs.Free;
end;
procedure TfrmMainForm.btnSaveClick(Sender: TObject);
begin
tc.SaveToBitmapFile(tc.Series[0].Title + '.bmp');
end;
procedure TfrmMainForm.DBEdit2KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
DBEdit3.SetFocus;
end;
end;
procedure TfrmMainForm.DBEdit3KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
DBEdit4.SetFocus;
end;
end;
procedure TfrmMainForm.DBEdit4KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
DBEdit5.SetFocus;
end;
end;
procedure TfrmMainForm.DBEdit5KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
DBEdit6.SetFocus;
end;
end;
procedure TfrmMainForm.DBEdit6KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
DBEdit7.SetFocus;
end;
end;
procedure TfrmMainForm.DBEdit7KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
DBEdit8.SetFocus;
end;
end;
procedure TfrmMainForm.TabSheet5Show(Sender: TObject);
var
ci : integer;
str : string;
begin
if not blshow then
begin
blshow := true;
tb.ColWidths[0] := 60;
for ci:=1 to tb.ColCount -1 do
begin
if ci <=33 then
str := inttostr(ci)
else
str := inttostr(ci-33);
if length(str) <2 then
str := '0' + str;
tb.Cells[ci,0] := str;
end;
if at.RecordCount >0 then
begin
at.First;
tb.RowCount := at.RecordCount +1;
ci:=1;
while not at.Eof do
begin
tb.Cells[0,ci] := at.fieldbyname('期号').AsString ;
tb.Cells[at.FieldByName('红色1').AsInteger ,ci] := at.fieldbyname('红色1').AsString ;
tb.Cells[at.FieldByName('红色2').AsInteger ,ci] := at.fieldbyname('红色2').AsString ;
tb.Cells[at.FieldByName('红色3').AsInteger ,ci] := at.fieldbyname('红色3').AsString ;
tb.Cells[at.FieldByName('红色4').AsInteger ,ci] := at.fieldbyname('红色4').AsString ;
tb.Cells[at.FieldByName('红色5').AsInteger ,ci] := at.fieldbyname('红色5').AsString ;
tb.Cells[at.FieldByName('红色6').AsInteger ,ci] := at.fieldbyname('红色6').AsString ;
tb.Cells[at.FieldByName('蓝色').AsInteger + 33 ,ci] := at.fieldbyname('蓝色').AsString ;
ci:=ci + 1;
at.Next;
end;
end;
end;
end;
procedure TfrmMainForm.ATAfterEdit(DataSet: TDataSet);
begin
blshow :=false;
end;
procedure TfrmMainForm.ATAfterDelete(DataSet: TDataSet);
begin
blshow :=false;
end;
procedure TfrmMainForm.ATAfterInsert(DataSet: TDataSet);
begin
blshow :=false;
end;
procedure TfrmMainForm.tbDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
if (Tstringgrid(sender).Cells[acol,arow] <>'') and (acol <>0) and (arow <>0) then
begin
with TStringGrid(Sender).Canvas do
begin
if acol <=33 then
begin
Brush.Color := clRed ;
Font.Color := clyellow;
end
else
begin
brush.Color := clblue;
font.Color := clwhite;
end;
FillRect(Rect);
TextOut(Rect.Left+2, Rect.Top +2, TStringGrid(Sender).Cells[ACol, ARow]); //自己算算位置吧
end;
end;
end;
procedure TfrmMainForm.GATAfterEdit(DataSet: TDataSet);
begin
blgmshow :=false;
end;
procedure TfrmMainForm.GATAfterInsert(DataSet: TDataSet);
begin
blgmshow :=false;
end;
procedure TfrmMainForm.GATBeforePost(DataSet: TDataSet);
begin
GAT.FieldByName('期号').Value:=ls;
end;
procedure TfrmMainForm.GATNewRecord(DataSet: TDataSet);
begin
GAT.FieldByName('购买期数').AsString:=LS;
DBEdit1.Text:=LS;
end;
procedure TfrmMainForm.GATAfterDelete(DataSet: TDataSet);
begin
blgmshow :=false;
end;
procedure TfrmMainForm.TabSheet4Show(Sender: TObject);
var
ci : integer;
str : string;
i,j:integer;
begin
if not blgmshow then
begin
gmtb.ColWidths[0] := 60;
for ci:=1 to gmtb.ColCount -1 do
begin
if ci <=33 then
str := inttostr(ci)
else
str := inttostr(ci-33);
if length(str) <2 then
str := '0' + str;
gmtb.Cells[ci,0] := str;
end;
if gat.RecordCount >0 then
begin
gat.First;
gmtb.RowCount := gat.RecordCount +1;
ci:=1;
while not gat.Eof do
begin
gmtb.Cells[0,ci] := gat.fieldbyname('购买期数').AsString ;
gmtb.Cells[gat.FieldByName('红色1').AsInteger ,ci] := gat.fieldbyname('红色1').AsString ;
gmtb.Cells[gat.FieldByName('红色2').AsInteger ,ci] := gat.fieldbyname('红色2').AsString ;
gmtb.Cells[gat.FieldByName('红色3').AsInteger ,ci] := gat.fieldbyname('红色3').AsString ;
gmtb.Cells[gat.FieldByName('红色4').AsInteger ,ci] := gat.fieldbyname('红色4').AsString ;
gmtb.Cells[gat.FieldByName('红色5').AsInteger ,ci] := gat.fieldbyname('红色5').AsString ;
gmtb.Cells[gat.FieldByName('红色6').AsInteger ,ci] := gat.fieldbyname('红色6').AsString ;
gmtb.Cells[gat.FieldByName('蓝色').AsInteger + 33 ,ci] := gat.fieldbyname('蓝色').AsString ;
ci:=ci + 1;
gat.Next;
end;
end;
for I := 1 to gmtb.ColCount do
begin
for j := 0 to gmtb.RowCount do
begin
if gmtb.Cells[i,j]='' then
begin
gmtb.Cells[i,j]:=' ';
end;
end;
end;
end;
end;
procedure TfrmMainForm.GMTBDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var
strhm : string;
begin
if (Tstringgrid(sender).Cells[acol,arow] <>'') and (acol <>0) and (arow <>0) then
begin
at.Filtered :=false;
at.Filter :='期号=''' + gmtb.Cells[0,arow] + '''';
at.Filtered :=true;
strhm := '''' + at.FieldByName('红色1').AsString + ''',';
strhm := strhm + '''' +at.FieldByName('红色2').AsString + ''',';
strhm := strhm + '''' +at.FieldByName('红色3').AsString + ''',';
strhm := strhm + '''' +at.FieldByName('红色4').AsString + ''',';
strhm := strhm + '''' +at.FieldByName('红色5').AsString + ''',';
strhm := strhm + '''' +at.FieldByName('红色6').AsString + '''';
with TStringGrid(Sender).Canvas do
begin
if acol <=33 then
begin
Brush.Color := clRed ;
Font.Color := clyellow;
end
else
begin
brush.Color := clblue;
font.Color := clwhite;
end;
if acol < 33 then
if pos(gmtb.Cells[acol,arow],strhm) <>0 then
begin
brush.Color := clYellow;
font.Color := clred;
end;
if acol >33 then
if gmtb.Cells[acol,arow]=at.FieldByName('蓝色').AsString then
begin
brush.Color := clYellow;
font.Color := clred;
end;
if gmtb.Cells[ACol,ARow]=' ' then
begin
if gmtb.Cells[0,Arow]=lastQS then
brush.Color :=clWhite
else
brush.Color :=clScrollBar;
end;
FillRect(Rect);
TextOut(Rect.Left+2, Rect.Top +2, TStringGrid(Sender).Cells[ACol, ARow]); //自己算算位置吧
at.Filtered :=false;
lastQS:=GMTB.Cells[0,arow+1];
end;
end;
end;
procedure TfrmMainForm.TabSheet4Hide(Sender: TObject);
begin
blgmshow :=true;
end;
procedure TfrmMainForm.wbNewWindow2(Sender: TObject; var ppDisp: IDispatch;
var Cancel: WordBool);
begin
cancel :=true;
end;
procedure TfrmMainForm.TabSheet6Show(Sender: TObject);
begin
//wb.Navigate('http://www.eastwhisht.cn');
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -