List view style zur Laufzeit aendern



  • Hi,

    ich moechte den Style meines List View Controls zur Laufzeit aendern. Alles was ich fand, war, dass das mit GetWindowLong und SetWindowLong geht. Leider stehe ich auf dem Schlauch. Kann mir jemand auf die Spruenge helfen?

    LONG style = GetWindowLong( GetListCtrl().m_hWnd, GWL_STYLE ) ;
    	style |= LVS_TYPEMASK ;
    	style &= LVS_SMALLICON ;
    	SetWindowLong( GetListCtrl().m_hWnd, GWL_STYLE, style ) ;
    


  • Woran hakt es denn?
    Ist es vielleicht das:

    LONG style = GetWindowLong( GetListCtrl().m_hWnd, GWL_STYLE ) ; 
    style |= LVS_TYPEMASK ; 
    style |= LVS_SMALLICON ; // statt &=
    SetWindowLong( GetListCtrl().m_hWnd, GWL_STYLE, style ) ;
    


  • Ich habs:

    LONG style = GetWindowLong( GetListCtrl().m_hWnd, GWL_STYLE ) ;
    style &= ~LVS_TYPEMASK ;
    style |= LVS_SMALLICON ;
    SetWindowLong( GetListCtrl().m_hWnd, GWL_STYLE, style ) ;

    Danke!



  • ggf. auch SetWindowPos(...) 😉 .


Anmelden zum Antworten