Einzelnen Beitrag anzeigen

MOLer

Registriert seit: 10. Mai 2007
13 Beiträge
 
Delphi XE2 Professional
 
#1

CheckBox in TOpendialog einfügen

  Alt 22. Okt 2007, 13:06
hallo,

das einfügen von 2 Checkboxen ist mir schon gelungen.
nun weiss ich allerdings nicht, wie ich nach dem schließen des dialogs
raus bekommen welche 'checked' ist und welche nicht.

würde mich über eure hilfe freuen

folgendes hab ich schon

Delphi-Quellcode:
procedure TUploadForm.OpenDlgOnShow(Sender: TObject);
var
  hParent: THandle;
  rect: TRect;
  hChkBox1: THandle;
  hChkBox2: THandle;
begin
  hParent := GetParent(OpenDialog.Handle);
  GetWindowRect(hParent, rect);
  SetWindowPos(hParent, 0, 0, 0, rect.Right - rect.Left, rect.Bottom - rect.Top
    + 50, SWP_NOMOVE);
  hChkBox1 := CreateWindowEx(0, 'BUTTON', 'Beschriftung BOX1', WS_CHILD or WS_VISIBLE or BS_AUTOCHECKBOX,
    195, rect.Bottom - rect.Top - 27, 265, 20, hParent, 101, 0, nil);
  hChkBox2 := CreateWindowEx(0, 'BUTTON', 'Beschriftung BOX2', WS_CHILD or WS_VISIBLE or BS_AUTOCHECKBOX,
    195, rect.Bottom - rect.Top - 2, 265, 20, hParent, 102, 0, nil);
  if hChkBox1 = 0 then RaiseLastOSError;
  if hChkBox2 = 0 then RaiseLastOSError;
end;


procedure TUploadForm.OpenDlgOnClose(Sender: TObject);
var hParent: THandle;
  hChkBox1: THandle;
  hChkBox2: THandle;
begin
  hParent := GetParent(OpenDialog.Handle);
  // get handle of checkboxes
  hChkBox1 := GetDlgItem(hParent, 101);
  hChkBox2 := GetDlgItem(hParent, 102);
end;


procedure TUploadForm.Button2Click(Sender: TObject);
begin
  OpenDialog.OnShow := OpenDlgOnShow;
  OpenDialog.OnClose := OpenDlgOnClose;
  OpenDialog.Execute();
end;
  Mit Zitat antworten Zitat