Herzlich Willkommen, lieber Gast!
  Sie befinden sich hier:

  Forum » VC++ / MFC » Spaltenbreite Listcontrol

Forum | Hilfe | Team | Links | Impressum | > Suche < | Mitglieder | Registrieren | Einloggen
  Quicklinks: MSDN-Online || STL || clib Reference Grundlagen || Literatur || E-Books || Zubehör || > F.A.Q. < || Downloads   

Autor Thread - Seiten: > 1 <
000
29.07.2003, 17:59 Uhr
~mutu
Gast


hallo!

wie verhindert man, daß die Spaltenbreite in einem ListControl verändert werden kann?
Mit sowas wie LstCtrl.GetItemWidth()...
einfach per SetItemWidth() zurücksetzen, wenn User Spaltenbr. ändern will??
Gibt es da keine Eigenschaft wie LVS_NOSCROLL oder so..?
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
001
30.07.2003, 10:50 Uhr
~Poirez
Gast


Hallo mutu
ich gloube das gibt es nicht, aber du kanst ein Handle auf den ListCtrlHeader erstellen und dann dort die ON_NOTIFY Message abfangen, denke ich jedenfalls, bin aber nicht ganz sicher.

Schau doch mal hier nach, da hat es recht viel wissenswertes über das ListCtrl:

www.codeguru.com/listview/index.shtml


Gruss Poirez
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
002
30.07.2003, 13:51 Uhr
~mutu
Gast


hallo!

habe in www.codeguru.com/listview/index.shtml etwas gefunden!
klappt jedoch noch nicht...

Original-Code:
"The header control in the ListView control sends notification to the parent window (e.i. the ListView) before it begins resizing a column. We can override the OnNotify() function in the CListCtrl derived class to handle this notification. The code below prevents resizing of all columns. Note that the resize cursor still shows up. "

BOOL CMyListCtrl::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
switch (((NMHDR*)lParam)->code)
{
case HDN_BEGINTRACKW:
case HDN_BEGINTRACKA:
*pResult = TRUE; // disable tracking
return TRUE; // Processed message
}

return CListCtrl::OnNotify(wParam, lParam, pResult);
}

mein Code:

Header:
...
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) ;
...

Source:
...
BEGIN_MESSAGE_MAP(CMyClass, CDialog)
...
ON_NOTIFY( LVN_COLUMNCLICK, IDC_LSTCTRL, OnNotify )
...
END_MESSAGE_MAP()

BOOL CMyClass::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
switch (((NMHDR*)lParam)->code)
{
case HDN_BEGINTRACKW:
case HDN_BEGINTRACKA:
*pResult = TRUE; // disable tracking
return TRUE; // Processed message
}

return CMyClass::OnNotify(wParam, lParam, pResult);
}

irgendwie stimmt die Message ON_NOTIFY() noch nicht, wenn eine spalte in ihrer größe verändert wird/werden soll ...
eine idee?
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
003
30.07.2003, 13:52 Uhr
~mutu
Gast


ach ja die Quelle: www.codeguru.com/listview/no_col_resize.shtml
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
Seiten: > 1 <     [ VC++ / MFC ]  


ThWBoard 2.73 FloSoft-Edition
© by Paul Baecher & Felix Gonschorek (www.thwboard.de)

Anpassungen des Forums
© by Flo-Soft (www.flo-soft.de)

Sie sind Besucher: