Autor Beitrag
counterto
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 123

Win XP
Delphi 2005 Prof., Visual Basic 2005, PHP, My Sql, Visual Basic 6
BeitragVerfasst: Do 23.03.06 18:14 
hallo Leutz,

ich habe ein kleines Problem. Ich will meine Datei als .bmp speichern, was soweit auch klappt, aber wenn ich den Savedialog aufrufe, dann steht unten immer noch als Dateityp .txt.
Ich suche ne Möglichkeit, den wegzumachen, oder einfach zu ändern in .bmp

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TForm2.Button2Click(Sender: TObject);
//Bekanntgabe der Variablen zum Speichern der ListviewInhalte
var z:        Integer;
    SaveList: TStringList;
begin
if (SaveDialog1.Execute) then begin
    SaveList := TStringList.Create;
    try
      with listview1 do
        for z := 0 to Pred(Items.Count) do
          SaveList.Add('"'+Items.Item[z].Caption+'",'+Items.Item [z].SubItems.CommaText);
          SaveList.SaveToFile(SaveDialog1.FileName+'.bmp');
    finally
      FreeAndNil(SaveList);
    end;
  end;
end;

_________________
Computer werden den Menschen immer ähnlicher - sie können bald alles, außer denken.
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Do 23.03.06 18:17 
Schau dir mal die Property Filter an

AXMD
Vera
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 82

WinXP Home
Delphi 2005 Personal
BeitragVerfasst: Do 23.03.06 18:17 
Schau dir mal die Eigenschaften DefaultExt, Filter und FilterIntedex der TSaveDialog Komponente an.
Danniolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 693



BeitragVerfasst: Do 23.03.06 18:19 
könnte das hier dir helfen: ?!
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure TForm2.Button2Click(Sender: TObject);
//Bekanntgabe der Variablen zum Speichern der ListviewInhalte
var z:        Integer;
    SaveList: TStringList;
    TempStr: String;
begin
if (SaveDialog1.Execute) then begin
    SaveList := TStringList.Create;
    try
      with listview1 do
        for z := 0 to Pred(Items.Count) do
          SaveList.Add('"'+Items.Item[z].Caption+'",'+Items.Item [z].SubItems.CommaText);
        TempStr := ChangeFileExt(SaveDialog1.FileName, '.exe');
        SaveList.SaveToFile(TempStr );
        CangeFileExt
    finally
      FreeAndNil(SaveList);
    end;
  end;
end;
starsurfer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 334

Win 95, Win 98, Win XP, Win Vista, Linux
D5 Enterprise ,D2005, D6 Personal, Visual C++ Express 2005, C++ Builder 6 E, Dev-C++
BeitragVerfasst: Do 23.03.06 19:54 
user profile iconDanniolo hat folgendes geschrieben:
könnte das hier dir helfen: ?!
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure TForm2.Button2Click(Sender: TObject);
//Bekanntgabe der Variablen zum Speichern der ListviewInhalte
var z:        Integer;
    SaveList: TStringList;
    TempStr: String;
begin
if (SaveDialog1.Execute) then begin
    SaveList := TStringList.Create;
    try
      with listview1 do
        for z := 0 to Pred(Items.Count) do
          SaveList.Add('"'+Items.Item[z].Caption+'",'+Items.Item [z].SubItems.CommaText);
        TempStr := ChangeFileExt(SaveDialog1.FileName, '.exe');
        SaveList.SaveToFile(TempStr );
        CangeFileExt
    finally
      FreeAndNil(SaveList);
    end;
  end;
end;


also als '.exe' würde ich das gleich gar nicht speichern :wink:

_________________
GEIZ IST GEIL! - Ihr Sozialamt
Danniolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 693



BeitragVerfasst: Fr 24.03.06 15:38 
war etwas in Gedanken, soll natürlich '.bmp' heißen :mrgreen: