Juin
26
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | procedure TfrmMain.AddIcon(iIndex: Integer); var gbOne : TGroupBox; imgOne: TImage; icOne : TIcon; begin icOne := TIcon.Create; try icOne.Handle := ExtractIcon(Handle, PWideChar(btnedFile.Text), iIndex); gbOne := TGroupBox.Create(Self); gbOne.Caption := IntToStr(iIndex); gbOne.Width := 38; gbOne.Height := 48; gbOne.OnClick := IconClick; gbOne.Cursor := crHandPoint; imgOne := TImage.Create(Self); imgOne.Width := 32; imgOne.Height := 32; imgOne.Top := 12; imgOne.Left := 3; imgOne.Transparent := True; imgOne.OnClick := IconClick; imgOne.Parent := gbOne; gbOne.Parent := flwpnlIcons; imgOne.Canvas.FillRect(rect(0, 0, 32, 32)); DrawIcon(imgOne.Canvas.Handle, 0, 0, icOne.Handle); except on E: Exception do begin MessageDlg('Une erreur s''est produite :' + #13#10#13#10 + e.Message, mtWarning, [mbOK], 0); Exit; end; end; icOne.Free; end; |

Pages : 1 2
Derniers commentaires