Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ausgewähltes in der Listbox umbennen

Empfohlene Antworten

Veröffentlicht

Folgendes,

also ich habe folgendes vor , bzw. ich stecke jetzt fest.

hab ganz simpel eine WindowsApplication mit einer Listbox.

Nun lese ich aus einem Order Daten mit einer bestimmten Endung ein

habe eingstellt , das er 2 bestimmte nicht mit ausgeben soll in der listbox

nun möchte ich ,

das wenn mann eine andere Datei in der Listbox anklickt

die Datei dich ich nicht mit eingelesen habe gelöscht wird

und die angeklickt datei deren namen erhält!

Sourcecode

void __fastcall TForm1::FormCreate(TObject *Sender)

{

WIN32_FIND_DATA FData;

AnsiString str;

HANDLE hSearch = FindFirstFile("C:\\Programme\\Gemeinsame Dateien\\Borland Shared\\BDE\\*.cfg",&FData);

BOOL MoreFiles = FALSE;

//int cnt_dir = 0, cnt_file = 0;

if (hSearch == INVALID_HANDLE_VALUE)

{

ShowMessage("Keine Dateien vorhanden!");

return;

}

do

{

if (FData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY)

{

str = FData.cFileName;

if (str != "IDAPI.CFG" &&

str != "IDAPI32.CFG")

ListBox1->Items->Add(FData.cFileName);

}

MoreFiles = FindNextFile(hSearch,&FData);

} while (MoreFiles);

FindClose(hSearch);

}

//---------------------------------------------------------------------------

void __fastcall TForm1::ListBox1Click(TObject *Sender)

{

KillDirectory

("C:\\Programme\\Gemeinsame Dateien\\Borland Shared\\BDE\\IDAPI.CFG"

&& "C:\\Programme\\Gemeinsame Dateien\\Borland Shared\\BDE\\IDAPI32.CFG");

MoveFile( , "IDAPI.CFG");

}

//---------------------------------------------------------------------------

  • Autor

genau

Ich wollte das mit mit

MoveFile( das was in der Listbox ausgeählt ist, umändern in neuen Dateinamen")

machen.und ich komme nicht drauf ich das machen musst mit "das was in der listbox ausgwählt ist"

Irgendwie mit ItemIndex aba ich brings net zum laufen, mir fehlt einfach jetzt das des klappt

MoveFile(ListBox1->ItemIndex[] ListBox1->ItemIndex["IDAPI.CFG"]);

kommt ein Expression Syntax fehler

also denk ich mal nicht das das die lösung is?!

achjah das KillDirectory hat net hingehauen

habs unkonventionell so gelöst

delete("C:\\Programme\\Gemeinsame Dateien\\Borland Shared\\BDE\\IDAPI.CFG");

delete ("C:\\Programme\\Gemeinsame Dateien\\Borland Shared\\BDE\\IDAPI32.CFG");

  • Autor

Schade das mir keiner helfen konnte,

hab das beschriebene Problem lösen können,

stehe aber wieder vor neuen ^^ :( jah so ist das

gelöst :

AnsiString str = ListBox1->Items->Strings[ListBox1->ItemIndex];

das in der Listbox ausgewählte wird abgespeichert und kann verwendet werden

korregiert mich wenn ich mich irre

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.