求摇奖程序
          请粘贴源码

解决方案 »

  1.   

    全局变量 
       
        i : Integer ;
        b : Boolean ;//先按 Button1 , 再显示中按 Button2 暂停,再按 Button2 循环procedure TForm1.Button1Click(Sender: TObject);
    begin
      while i < 31 do
      begin
        if b then
        begin
          Label1.Caption := IntToStr(i) ;
          Application.ProcessMessages ;
          Inc(i) ;
          Sleep(1000) ;
        end
        else break ;
      end ;
    end;procedure TForm1.Button2Click(Sender: TObject);
    begin
      if b then
      begin
        b := False ;
      end
      else
      begin
        b := True ;
        Button1Click(Button1) ;
      end ;
    end;
      

  2.   

    FormCreate 中,初始 i := 0 ; B := True ;
      

  3.   

    我要的图形化界面,以及实现思想。
    你那样的程序我已搞定。
    procedure TForm1.Timer1Timer(Sender: TObject);
    var
      IntA, IntB, IntC, IntD, IntE, IntF: Integer;
    begin
      Randomize;
      IntA := Random(IntRange);
      Panel1.Caption := IntToStr(IntA);  IntB := Random(IntRange);
      while (IntB = IntA) do
        IntB := Random(IntRange);
      Panel2.Caption := IntToStr(IntB);  IntC := Random(IntRange);
      while (IntC = IntA) or (IntC = IntB) do
        IntC := Random(IntRange);
      Panel3.Caption := IntToStr(IntC);  IntD := Random(IntRange);
      while (IntD = IntA) or (IntD = IntB) or (IntD = IntC)do
        IntD := Random(IntRange);
      Panel4.Caption := IntToStr(IntD);  IntE := Random(IntRange);
      while (IntE = IntA) or (IntE = IntB) or (IntE = IntC) or (IntE = IntD) do
        IntE := Random(IntRange);
      Panel5.Caption := IntToStr(IntE);  IntF := Random(IntRange);
      while (IntF = IntA) or (IntF = IntB) or (IntF = IntC) or (IntF = IntD) or (IntF = IntE) do
        IntF := Random(IntRange);
      Panel6.Caption := IntToStr(IntF);  Panel7.Caption := IntToStr(Random(IntRange));
    end;
      

  4.   

    将图像保存在数据库(或者保存其路径),加一个ID(标识自增)字段,
    在那个Button1Click中 ,Order By NewID() 取随机ID , 得到图片或路径
    可以吗 ?
      

  5.   

    var
      j,k : integer;
      Data : Array[0..6] of integer;
      Ok : Boolean;
    begin
        for j := 0 to 6 do
        begin
           Ok := false;
           While Not Ok do
           begin
             Data[j] := Trunc(Random(35)+1);
             Ok := True;
             for k := 0 to j-1 do
             begin
               if Data[k] = Data[j] then
               begin
                 Ok := false;
                 Break;
               end;
             end;
           end
        end;