⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainform.pas

📁 这是一个关于双色球走势的例子,希望对大家有点帮助.
💻 PAS
📖 第 1 页 / 共 2 页
字号:
          begin
            adata[aq.FieldByName('红色3').AsInteger ] := adata[aq.FieldByName('红色3').AsInteger ]  +1;
          end;
         if (aq.FieldByName('红色4').AsInteger + 2 = aq.FieldByName('红色5').AsInteger) and (aq.FieldByName('红色5').AsInteger + 2 = aq.FieldByName('红色6').AsInteger)  then
          begin
             adata[aq.FieldByName('红色4').AsInteger ] := adata[aq.FieldByName('红色4').AsInteger ]  +1;
          end;
          aq.Next;
      end
    end;
  end;


end;

procedure TfrmMainForm.FQFWChange(Sender: TObject);
begin
  Totaldata();
  setvalue(tc);
end;

procedure TfrmMainForm.TabSheet2Show(Sender: TObject);
begin
Totaldata();
setvalue(tc);
end;

procedure TfrmMainForm.SetValue(tc : Tchart);
var
 i : integer;
begin

tc.Series[0].Clear;

  case tbfs.ItemIndex of
  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.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.GATAfterDelete(DataSet: TDataSet);
begin
blgmshow :=false;
end;

procedure TfrmMainForm.TabSheet4Show(Sender: TObject);

var
 ci : integer;
 str : string;
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;
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;

    FillRect(Rect);

    TextOut(Rect.Left+2, Rect.Top +2, TStringGrid(Sender).Cells[ACol, ARow]); //自己算算位置吧
    at.Filtered :=false;
  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 + -