-
2011. 4. 19. 06:31 Tutorials/IDE]Delphi 7.2
버튼 3개를 만들어서 다이얼로그를 보여주도록 만들겠습니다.
VCL 목록 다이얼로그 텝에서 사용할 다이얼로그를 폼에 첨가 합니다.
Tip : JEDI 컴포넌트에 폴더 다이얼로그가 있습니다.
Open, Save, Color 를 선택 하였습니다
각 커트롤의 속성창
코드는 매우 간단하여 번거로움 없이 개발에 사용 할 수 있겠습니다.
procedure
TForm1.SpeedButton1Click(Sender: TObject);
begin
OpenDialog1.Title:='열기';
OpenDialog1.Filter:='AnyThing|*';
OpenDialog1.Options := [ofAllowMultiSelect,ofEnableSizing,ofForceShowHidden];
if OpenDialog1.Execute() then begin
ShowMessage( OpenDialog1.Files.Text );//Multi Files
// OpenDialog1.Files.Count
// OpenDialog1.Files.Strings[i]
// OpenDialog1.FileName
end;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
SaveDialog1.Title:='저장';
SaveDialog1.Filter:='AnyThing|*';
SaveDialog1.Options := [ofAllowMultiSelect,ofEnableSizing,ofForceShowHidden];
if SaveDialog1.Execute() then begin
ShowMessage( SaveDialog1.Files.Text );//Multi Files
// SaveDialog1.Files.Count
// SaveDialog1.Files.Strings[i]
// SaveDialog1.FileName
end;
end;
procedure TForm1.SpeedButton3Click(Sender: TObject);
begin
ColorDialog1.Options := [cdFullOpen,cdPreventFullOpen,cdSolidColor,cdAnyColor];
if ColorDialog1.Execute() then begin
ShowMessage( ColorToString( ColorDialog1.Color ) );//Color to String
end;
end;
begin
OpenDialog1.Title:='열기';
OpenDialog1.Filter:='AnyThing|*';
OpenDialog1.Options := [ofAllowMultiSelect,ofEnableSizing,ofForceShowHidden];
if OpenDialog1.Execute() then begin
ShowMessage( OpenDialog1.Files.Text );//Multi Files
// OpenDialog1.Files.Count
// OpenDialog1.Files.Strings[i]
// OpenDialog1.FileName
end;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
SaveDialog1.Title:='저장';
SaveDialog1.Filter:='AnyThing|*';
SaveDialog1.Options := [ofAllowMultiSelect,ofEnableSizing,ofForceShowHidden];
if SaveDialog1.Execute() then begin
ShowMessage( SaveDialog1.Files.Text );//Multi Files
// SaveDialog1.Files.Count
// SaveDialog1.Files.Strings[i]
// SaveDialog1.FileName
end;
end;
procedure TForm1.SpeedButton3Click(Sender: TObject);
begin
ColorDialog1.Options := [cdFullOpen,cdPreventFullOpen,cdSolidColor,cdAnyColor];
if ColorDialog1.Execute() then begin
ShowMessage( ColorToString( ColorDialog1.Color ) );//Color to String
end;
end;