Thema: Delphi Minesweeper

Einzelnen Beitrag anzeigen

saii

Registriert seit: 20. Feb 2015
22 Beiträge
 
#30

AW: Minesweeper

  Alt 24. Mär 2015, 19:00
Himitsu, ich erstelle die Panels automatisch und benenne sie (warum weiß ich auch nicht, wie ich gerade bemerke)

Von daher weiß ich auch nicht, wie ich die zweistellig benennen soll.
Delphi-Quellcode:
procedure TForm1.CreatePanelMatrix(x1, y1: Integer);
var
  x,y:integer;
begin
  for x := 0 to 14 do
    for y := 0 to 14 do
    begin
      Panel := TPanel.Create(Self);
      Panel.Parent := Self;
      Panel.Name := 'P_' + IntToStr(x) + '_' + IntToStr(y);
      Panel.Width := 30;
      Panel.Height := 30;
      Panel.Caption := '';
      Panel.Left := x1 + (x * 30);
      Panel.Top := y1 + (y * 30);
      Panel.OnMouseDown := PanelMatrixMouseDown;
    end;
end;
  Mit Zitat antworten Zitat