Na otevreni noveho okna si vytvor novy formular za behu aplikace , pro potrebne componenty pak prirad ownera , napriklad (je toho spousta na webu staci hledat !!)
begin
Select := TForm.Create(Videokazety);
with Select do
begin
Top := 0;
Left := 0;
Width := 1024;
Height := 160;
Name := 'Videokazety';
Caption := Videokazety';
Onclose:=form8.Onclose;
Show;
end;
end;
pro vytvoreni komponenty (jakekoliv ve formulari videokazety)
listbox:=Tlistbox.create(Select);
listbox.Parent:= Select;
with listbox do
begin
Left := 0;
Top := 0;
Width := 250;
Height := 140;
Name := 'zaznam';
enabled:=true;
visible:=true;
show;
end;
end;
Na dalsi uz prijdes sam jen malinko napomuzu , pro editaci v novem okne musis v materskem formulari pridat vlastni funkci ktera se ti postara o ukladani a podobnych veci stejny zpusob je se vsim , jde to udelat i jako sadu listbox:array [1..2] of Tlistbox; a podobne
OpenDirectory dialog (zakusek)
do klausuli pridej >>ShellAPI, ShlObj<<
// pro vyhledavani adresare
function ProhledejDialogNavrat(Wnd: HWND; uMsg: UINT; lParam, lpData: LPARAM):
integer stdcall;
var
wa, rect : TRect;
dialogPT : TPoint;
begin
if uMsg = BFFM_INITIALIZED then
begin
wa := Screen.WorkAreaRect;
GetWindowRect(Wnd, Rect);
dialogPT.X := ((wa.Right-wa.Left) div 2) -
((rect.Right-rect.Left) div 2);
dialogPT.Y := ((wa.Bottom-wa.Top) div 2) -
((rect.Bottom-rect.Top) div 2);
MoveWindow(Wnd,
dialogPT.X,
dialogPT.Y,
Rect.Right - Rect.Left,
Rect.Bottom - Rect.Top,
True);
end;
Result := 0;
end;
function ProhledejDialog(const Nazev: string; const Flag: integer): string;
var
lpItemID : PItemIDList;
BrowseInfo : TBrowseInfo;
DisplayName : array[0..max_path] of char;
TempPath : array[0..max_path] of char;
begin
Result:='';
FillChar(BrowseInfo, sizeof(TBrowseInfo), #0);
with BrowseInfo do begin
hwndOwner := Application.Handle;
pszDisplayName := @DisplayName;
lpszTitle := PChar(Nazev);
ulFlags := Flag;
lpfn := ProhledejDialogNavrat;
end;
lpItemID := SHBrowseForFolder(BrowseInfo);
if lpItemId <> nil then begin
SHGetPathFromIDList(lpItemID, TempPath);
Result := TempPath;
GlobalFreePtr(lpItemID);
end;
end;