Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionProcedure TForm1.FormResize(Sender: TObject); begin with GroupBox1 do begin Top:=Form1.ClientHeight - 16 + (GroupBox1.Height div 2); Left:=Form1.ClientWidth div 2 + (GroupBox1.Width div 2); end; with GroupBox2 do begin Top:=Form1.ClientHeight - 16 + (GroupBox2.Height div 2); Left:=Form1.ClientWidth * 3 div 4 + (GroupBox2.Width div 2); end; with MediaPlayer1 do begin Top:=GroupBox1.Top + GroupBox1.Height div 2 + (MediaPlayer1.Height div 2); Left:=Form1.ClientWidth * 1 div 4 + (MediaPlayer1.Width div 2); end; with Image1 do begin Width:=Form1.ClientWidth - 16; Height:=Form1.ClientHeight - GroupBox1.Height - 16 - 8; Top:=8; Left:=8; end; end;
procedure TForm1.FormCreate(Sender: TObject); var Res : TResourceStream; lengthFile :integer; begin Res:=TResourceStream.Create(0,'CHANSON001','MP3'); Res.SaveToFile(ExtractFilePath(Application.ExeName) + 'CHANSON001.mp3'); Res.Free; Res:=TResourceStream.Create(0,'CHANSON002','MP3'); Res.SaveToFile(ExtractFilePath(Application.ExeName) + 'CHANSON002.mp3'); Res.Free; Res:=TResourceStream.Create(0,'CHANSON003','MP3'); Res.SaveToFile(ExtractFilePath(Application.ExeName) + 'CHANSON003.mp3'); Res.Free; Res:=TResourceStream.Create(0,'CHANSON004','MP3'); Res.SaveToFile(ExtractFilePath(Application.ExeName) + 'CHANSON004.mp3'); Res.Free; if FileExists(ParamStr(1)) then ouvrefichier(ParamStr(1),MediaPlayer1,Image1); end;
procedure TForm1.FormResize(Sender: TObject); begin with GroupBox1 do begin Top:=Form1.ClientHeight - 16 + (GroupBox1.Height div 2); Left:=Form1.ClientWidth div 2 + (GroupBox1.Width div 2); end; with GroupBox2 do begin Top:=Form1.ClientHeight - 16 + (GroupBox2.Height div 2); Left:=Form1.ClientWidth * 3 div 4 + (GroupBox2.Width div 2); end; with MediaPlayer1 do begin Top:=GroupBox1.Top + GroupBox1.Height div 2 + (MediaPlayer1.Height div 2); Left:=Form1.ClientWidth * 1 div 4 + (MediaPlayer1.Width div 2); end; with Image1 do begin Width:=Form1.ClientWidth - 16; Height:=Form1.ClientHeight - GroupBox1.Height - 16 - 8; Top:=8; Left:=8; end; end;