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.

Empfohlene Antworten

Veröffentlicht

Hallo Leute,

ich habe ein CListCtrl-Feld in meinem Dialog mit Bericht-Ansicht.

Ich möchte den Eintrag in der ersten Spalte editieren.

Im Moment sieht es so aus:


void C[Programm]Dlg::OnLvnItemActivateList2Buch(NMHDR *pNMHDR, LRESULT *pResult)

 {

     LPNMITEMACTIVATE pNMIA = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);


 //Aktiviert das Editfeld nach Doppelklick auf das Item

 m_cBuch.EditLabel(m_cBuch.GetSelectionMark());


       *pResult = 0;

 }//end void

Ich gebe einen neuen Text ein und drücke Enter. Der Inhalt ändert sich nicht.

In der MSDN hat auch nichts weiter gestanden.

  • Autor

Ich habe es gestern selbst mit viel experimentieren herausbekommen:


//Das Editfeld wird auf dem markierten Item erstellt, wenn auf das Item doppelt

  geklickt wurde

void [Projekt]Dlg::OnLvnItemActivateList2(NMHDR *pNMHDR, LRESULT *pResult)

 {

  LPNMITEMACTIVATE pNMIA = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);


  m_cList.EditLabel(m_cList.GetSelectionMark());


  *pResult = 0;

 }//end void


//Nachdem Enter gedrückt wurde, wird der Inhalt des Editfeldes ausgelesen und

  dem Item als neuer Text zugewiesen

void [Projekt]Dlg::OnLvnEndlabeleditList2(NMHDR *pNMHDR, LRESULT *pResult)

 {

     NMLVDISPINFO *pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);

     CString Text;


     CEdit *pEdit=m_cList.GetEditControl();


     pEdit->GetWindowText(Text);


     m_cList.SetItemText(m_cList.GetSelectionMark(), 0, Text);


     *pResult = 0;

 }//end void

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.