Ver Mensaje Individual
  #2  
Antiguo 14-12-2017
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.

Una opción es,

.h
Código PHP:
...
class 
TForm1 : public TForm
{
__published:    // IDE-managed Components
  
TListBox *ListBox1;
  
void __fastcall FormCreate(TObject *Sender);
  
void __fastcall FormDestroy(TObject *Sender);  
private:    
// User declarations
  
TWndMethod _oldwndProc;
  
void __fastcall newWndProc(TMessageMessage);
  
void __fastcall vertScroll(TObject *Sender);
public:        
// User declarations
  
__fastcall TForm1(TComponentOwner);
};
... 
.cpp:
Código PHP:
...
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  
_oldwndProc ListBox1->WindowProc;
  
ListBox1->WindowProc newWndProc;
  
ListBox1->ItemIndex  0;
}

void __fastcall TForm1::newWndProc(TMessageMessage)
{
  if(
Message.Msg == WM_VSCROLL)
    
vertScroll(ListBox1);
  
_oldwndProc(Message);
}

void __fastcall TForm1::vertScroll(TObject *Sender)
{
  
ListBox1->Selected[GetScrollPos(ListBox1->HandleSB_VERT)] = true;
}

...

void __fastcall TForm1::FormDestroy(TObject *Sender)
{
  
ListBox1->WindowProc _oldwndProc;

Salida:


Saludos
__________________
Daniel Didriksen

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

Última edición por ecfisa fecha: 14-12-2017 a las 22:39:43.
Responder Con Cita