Ver Mensaje Individual
  #2  
Antiguo 03-02-2014
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola andres_89.

Lo que buscas no lo veo posible, pero podes ajustar al cliente las columnas existentes e impedir que las redimensionen, un ejemplo:

Unit1.h:
Código:
...
class TForm1 : public TForm
{
__published:	// IDE-managed Components
  TListView *ListView1;
  void __fastcall FormCreate(TObject *Sender);
private:	// User declarations
  void __fastcall ListViewWindowProc(TMessage &Msg);
...
}
Unit1.cpp
Código:
...

TWndMethod OldListViewProc = NULL;

__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)
{
  OldListViewProc = ListView1->WindowProc;
  ListView1->WindowProc = ListViewWindowProc;
}

// Impedir redimension
void __fastcall TForm1::ListViewWindowProc(TMessage &Msg)
{
  if(Msg.Msg == WM_NOTIFY) {
    const NMHDR *hdr = (NMHDR*) Msg.LParam;
    if((hdr->code==HDN_BEGINTRACKA) || (hdr->code==HDN_BEGINTRACKW) ||
      (hdr->code==HDN_DIVIDERDBLCLICKA) || (hdr->code == HDN_DIVIDERDBLCLICKW)){
      Msg.Result = TRUE;
      return;
    }
  }
  OldListViewProc(Msg);
}

// Ajustar columnas
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  TListView* LV = static_cast<TListView*>(ListView1);
  LV->Column[0]->Width = LV->Width - LV->Column[0]->Width - 4;
}
En cuanto a tu otra consulta, por favor abrí un nuevo tema con ella.

Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita