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

📄 u_form_blue.pas.bak

📁 双色球分析软件
💻 BAK
📖 第 1 页 / 共 3 页
字号:
unit U_Form_Blue;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, ADODB, ImgList, StdCtrls, ExtCtrls, TeeShape, TeEngine,
  Series, TeeProcs, Chart, EasyGrid, ComCtrls;

type
  TForm_Blue = class(TForm)
    Image1: TImage;
    Image2: TImage;
    Bevel1: TBevel;
    Label1: TLabel;
    TabCtrl: TPageControl;
    TabSheet1: TTabSheet;
    TabSheet3: TTabSheet;
    Panel1: TPanel;
    Label2: TLabel;
    Chart1: TChart;
    Series1: TLineSeries;
    Series2: TLineSeries;
    Chart2: TChart;
    LineSeries1: TLineSeries;
    Chart3: TChart;
    Chart4: TChart;
    LineSeries3: TLineSeries;
    Chart5: TChart;
    LineSeries4: TLineSeries;
    ComboBox7: TComboBox;
    TabSheet5: TTabSheet;
    TabSheet7: TTabSheet;
    TabSheet10: TTabSheet;
    TabSheet12: TTabSheet;
    TabSheet2: TTabSheet;
    TabSheet4: TTabSheet;
    ImageList1: TImageList;
    ADOQuery1: TADOQuery;
    Grid1_1: TEasyGrid;
    Grid1_2: TEasyGrid;
    Grid1_3: TEasyGrid;
    Grid1_4: TEasyGrid;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label9: TLabel;
    Series3: TBarSeries;
    Label8: TLabel;
    Grid2_1: TEasyGrid;
    Grid2_2: TEasyGrid;
    Grid2_3: TEasyGrid;
    Grid2_4: TEasyGrid;
    Grid2_5: TEasyGrid;
    Label10: TLabel;
    ComboBox1: TComboBox;
    procedure FormCreate(Sender: TObject);
    procedure Image2Click(Sender: TObject);
    procedure TabCtrlDrawTab(Control: TCustomTabControl; TabIndex: Integer;
      const Rect: TRect; Active: Boolean);
    procedure Grid1_1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TEasyGridDrawState);
    procedure Grid1_2DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TEasyGridDrawState);
    procedure Grid1_3DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TEasyGridDrawState);
    procedure TabCtrlChange(Sender: TObject);
    procedure ComboBox7Click(Sender: TObject);
    procedure ComboBox1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form_Blue: TForm_Blue;
  CP_data:Array[1..100,1..100] of integer;
  CP_SID:Array[1..100] of string;
implementation

{$R *.dfm}
uses common,U_Draw,U_Constant;
procedure TForm_Blue.FormCreate(Sender: TObject);
var
    i,j:integer;
    sMax:string;
    CurrentPath:string;
begin
     ShowPloyForm(image1.picture.bitmap,handle);
     CurrentPath:=ExtractFilePath(ParamStr(0));
///////为第一个表格设置开始////////////////////////////////////
     combobox7.Items.Add('除3走势');
     combobox7.Items.Add('除4走势');
     combobox7.Items.Add('除5走势');
     combobox7.Items.Add('除6走势');
     /////添加标题//////////////////////////////
     grid1_1.RowHeights[1]:=20;
     grid1_1.Cells[1,1].ForeText:='期号';
     grid1_1.ColWidths[1]:=40;
     grid1_1.Cells[1,1].Color:=rgb(58,110,165);
     grid1_1.cells[1,1].FontSize:=9;
     ////////////////////////////////////////////////
     for i:=2 to grid1_1.ColCount-1 do
     begin
         grid1_1.ColWidths[i]:=18;
         grid1_1.cells[i,1].Color:=rgb(255,255,0);
         grid1_1.Cells[i,1].ForeText:=inttostr(i-1);
     end;///

     /////取得最大的期号/////////////////////////
     with AdoQuery1 do
     begin
         connectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+CurrentPath+'\sale.mdb;Persist Security Info=False';
         close;
         sql.Clear;
         sql.Add('Select Top 1 * From  CPData  order by  sID desc');
         prepared;
         open;
         if recordcount<>0 then
         begin
            sMax:=FieldByName('sID').AsString;
         end;//if

     end;////with
     s_EndID:=trim(sMax);
     s_beginId:=formatFloat('##0',strToInt(trim(sMax))-27);
     ///////首先取得数据//////////////////////////////
      ///////显示双色球记录////////////////////
     with AdoQuery1 do
     begin
         connectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+CurrentPath+'\sale.mdb;Persist Security Info=False';
         close;
         sql.Clear;
         sql.Add('Select * From  CPdata  Where  sID>=:sb and  sID<=:se order By sID');
         parameters.ParamByName('sb').Value:=trim(s_BeginId);
         parameters.ParamByName('se').Value:=trim(s_EndId);
         prepared;
         open;
         if recordcount<>0 then
         begin
            i:=1;
            while not Eof do
            begin
                 grid1_1.RowCount:=i+4;

                 grid1_1.Cells[1,i+1].ForeText:=trim(FieldByName('sID').AsString);
                 CP_SID[i]:=trim(FieldByName('sID').AsString);
                 
                 grid1_1.Cells[strToInt(trim(FieldByName('b1').AsString))+1,i+1].ForeText:=trim(FieldByName('b1').AsString);
                 CP_Data[i,1]:=strToInt(trim(FieldByName('b1').AsString));

                 next;
                 inc(i);
            end;///while
         end;//if
     end;//with
      /////为第一列设置背景颜色和字体颜色/////////////
     for  i:=1 to grid1_1.rowcount-3 do
     begin
          grid1_1.Cells[1,i].Color:=rgb(58,110,165);
          grid1_1.Cells[1,i].FontColor:=rgb(255,255,255);
     end;//for
     ///////为最后一行设置////////////////////////
     grid1_1.rowheights[grid1_1.rowcount-2]:=18;
     grid1_1.Cells[1,grid1_1.rowcount-2].foretext:='预测';
     grid1_1.Cells[1,grid1_1.rowcount-2].color:=rgb(0,255,0);
     grid1_1.Cells[1,grid1_1.rowcount-1].foretext:='球号';
     grid1_1.Cells[1,grid1_1.rowcount-1].color:=rgb(0,255,0);
     for i:=2 to grid1_1.ColCount-1 do
     begin
         grid1_1.ColWidths[i]:=18;
         grid1_1.cells[i,grid1_1.rowcount-2].Color:=rgb(255,255,0);
         grid1_1.Cells[i,grid1_1.rowcount-2].ForeText:=inttostr(i-1);
     end;///
///////为第一个表格设置结束////////////////////////////////////
///////为第二个表格设置开始/////////////////////////////////////
     ////////////////////////////////////////////////
     grid1_2.RowHeights[1]:=20;
     for i:=1 to 8 do
     begin
         //grid1_2.ColWidths[i]:=18;
         grid1_2.cells[i,1].Color:=rgb(255,255,0);
         grid1_2.Cells[i,1].ForeText:=inttostr(i*2-1);
     end;///
     for i:=9 to 16 do
     begin
         //grid1_2.ColWidths[i]:=18;
         grid1_2.cells[i,1].Color:=rgb(255,255,0);
         grid1_2.Cells[i,1].ForeText:=inttostr((i-8)*2);
     end;///
     ////显示数据////////////////////////////
     grid1_2.rowcount:=grid1_1.rowcount;
     for i:=1 to 28 do
         begin
             for j:=1 to 16 do
             begin
                 if CP_Data[i,1]=j then
                 begin
                    if (CP_Data[i,1] mod 2)=0 then
                    begin
                       grid1_2.Cells[strToInt(formatFloat('##0',(8+j/2))),i+1].ForeText:=inttostr(j);
                    end;
                    if (CP_Data[i,1] mod 2)=1 then
                    begin
                       grid1_2.Cells[strToInt(formatFloat('##0',((j+1)/2))),i+1].ForeText:=inttostr(j);
                    end;
                 end;//if
             end;
         end;///for i
      ///////为最后一行设置////////////////////////
     grid1_2.rowheights[grid1_2.rowcount-2]:=19;

     for i:=2 to grid1_2.ColCount-1 do
     begin

         grid1_2.cells[i-1,grid1_2.rowcount-2].Color:=rgb(255,255,0);
         //grid1_2.Cells[i-1,grid1_2.rowcount-2].ForeText:=inttostr(i-1);
     end;///
     for i:=1 to 8 do
     begin
         //grid1_2.ColWidths[i]:=18;
         grid1_2.cells[i,grid1_2.rowcount-2].Color:=rgb(255,255,0);
         grid1_2.Cells[i,grid1_2.rowcount-2].ForeText:=inttostr(i*2-1);
     end;///
     for i:=9 to 16 do
     begin
         //grid1_2.ColWidths[i]:=18;
         grid1_2.cells[i,grid1_2.rowcount-2].Color:=rgb(255,255,0);
         grid1_2.Cells[i,grid1_2.rowcount-2].ForeText:=inttostr((i-8)*2);
     end;///
///////为第二个表格设置结束//////////////////////////////////////////////
///////为第三个表格设置开始//////////////////////////////////////////////
     grid1_3.RowHeights[1]:=20;
     for i:=1 to 16 do
     begin
         //grid1_2.ColWidths[i]:=18;
         grid1_3.cells[i,1].Color:=rgb(255,255,0);
         //grid1_3.Cells[i,1].ForeText:=inttostr(i*2-1);
     end;///
     grid1_3.Cells[1,1].ForeText:='1';
     grid1_3.Cells[2,1].ForeText:='4';
     grid1_3.Cells[3,1].ForeText:='7';
     grid1_3.Cells[4,1].ForeText:='10';
     grid1_3.Cells[5,1].ForeText:='13';
     grid1_3.Cells[6,1].ForeText:='16';
     grid1_3.Cells[7,1].ForeText:='2';
     grid1_3.Cells[8,1].ForeText:='5';
     grid1_3.Cells[9,1].ForeText:='8';
     grid1_3.Cells[10,1].ForeText:='11';
     grid1_3.Cells[11,1].ForeText:='14';
     grid1_3.Cells[12,1].ForeText:='3';
     grid1_3.Cells[13,1].ForeText:='6';
     grid1_3.Cells[14,1].ForeText:='9';
     grid1_3.Cells[15,1].ForeText:='12';
     grid1_3.Cells[16,1].ForeText:='15';
     ////显示数据////////////////////////////
     grid1_3.rowcount:=grid1_1.rowcount;
     for i:=1 to 28 do
         begin
             for j:=1 to 16 do
             begin
                 if CP_Data[i,1]=j then
                 begin
                    if (CP_Data[i,1] mod 3)=1 then
                    begin
                       grid1_3.Cells[strToInt(formatFloat('##0',(1+(j-1)/3))),i+1].ForeText:=inttostr(j);
                    end;
                    if (CP_Data[i,1] mod 3)=2 then
                    begin
                       grid1_3.Cells[strToInt(formatFloat('##0',(7+(j-2)/3))),i+1].ForeText:=inttostr(j);
                    end;
                    if (CP_Data[i,1] mod 3)=0 then
                    begin
                       grid1_3.Cells[strToInt(formatFloat('##0',(12+(j-3)/3))),i+1].ForeText:=inttostr(j);
                    end;
                 end;//if
             end;
         end;///for i
         for i:=1 to 16 do
     begin
         //grid1_2.ColWidths[i]:=18;
         grid1_3.cells[i,grid1_3.rowcount-2].Color:=rgb(255,255,0);
         //grid1_3.Cells[i,1].ForeText:=inttostr(i*2-1);
     end;///
         grid1_3.Cells[1,grid1_3.rowcount-2].ForeText:='1';
         grid1_3.Cells[2,grid1_3.rowcount-2].ForeText:='4';
         grid1_3.Cells[3,grid1_3.rowcount-2].ForeText:='7';
         grid1_3.Cells[4,grid1_3.rowcount-2].ForeText:='10';
         grid1_3.Cells[5,grid1_3.rowcount-2].ForeText:='13';
         grid1_3.Cells[6,grid1_3.rowcount-2].ForeText:='16';
         grid1_3.Cells[7,grid1_3.rowcount-2].ForeText:='2';
         grid1_3.Cells[8,grid1_3.rowcount-2].ForeText:='5';

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -