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.

CListCtrl / Kontextmenü

Empfohlene Antworten

Veröffentlicht

Hi. Ich habe eine SDI-Anwendung mit einem CListCtrl, in dem Daten aus einer Datenbank dargestellt werden. Ich möchte nun ein Kontextmenü hinzufügen. Bei Auswahl eines Eintrags soll sich ein neues Dialogfeld öffnen, in dem der gerade markierte Eintrag des CListCtrls mit Hilfe von Eingabefeldern dargestellt wird.

void CProjektView::OnRclickListe(NMHDR* pNMHDR, LRESULT* pResult) 

{

  NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;


  int iSpalte = pNMListView->iSubItem;

  int zeile = m_liste.GetNextItem(-1, LVNI_SELECTED);


    CMenu menu;

    CPoint point;


    VERIFY(menu.LoadMenu(IDR_KONTEXT2));


    CMenu* pPopup = menu.GetSubMenu(0);

    ASSERT(pPopup != NULL);


    CWnd* pWndPopupOwner = this;


    while (pWndPopupOwner->GetStyle() & WS_CHILD)

        pWndPopupOwner = pWndPopupOwner->GetParent();


    GetCursorPos(&point);


    pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y,

        pWndPopupOwner);   

    *pResult = 0;

}

Obige Methode befindet sich in der View und greift auf das CListCtrl zu. Wie kann ich nun aus dem neuen Dialogfeld für das eine separate Klasse erstellt wurde, auf das CListCtrl zugreifen?

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.