| Ver tema anterior :: Ver tema siguiente |
| Autor |
Mensaje |
lila Cdt

Registrado: 30 Nov 2003Mensajes: 8
|
Publicado: Mie 03 Dic, 2003 1:53 am Asunto: autocompletar una direccion web |
|
|
quisiera saber como puedo autocompletar una direccion web cuando estoy utilizando un ComboBox para mis Url's.
por favor ayudenme es que no hayo como hacerlo, gracias |
|
| Volver arriba |
|
 |
_Viktor Master


Registrado: 20 Jul 2003Mensajes: 463Ubicación: Santiago, Los Angeles - Chile
|
Publicado: Mie 03 Dic, 2003 2:17 am Asunto: |
|
|
Esto te servira:
| Código: |
//-------------UNIT1.CPP-----------------------------------------------------
#include
#pragma hdrstop
#include "Main.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
Table1->Open();
Table1->First();
while (!Table1->Eof)
{
cb->Items->Add(Table1->FieldByName("Dato")->AsString);
Table1->Next();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::cbKeyPress(TObject *Sender, char &Key)
{
lastkey = Key;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::cbChange(TObject *Sender)
{
String srch = cb->Text;
if ((lastkey == 0x08) || (lastkey == VK_DELETE))
{
lastkey = 0;
return;
}
lastkey = 0;
int ix = cb->Perform(CB_FINDSTRING,-1,(LPARAM)srch.c_str());
if (ix != CB_ERR)
{
cb->ItemIndex = ix;
cb->SelStart = srch.Length();
cb->SelLength = (cb->Text.Length()-srch.Length());
}
}
//--------------------------------------------------------------------------- |
y finalmente :
| Código: | //-------------UNIT1.H-----------------------------------------------------
public: // User declarations
WORD lastkey; |
Saludos! _________________ "Ser inteligente no es ser mas, solo equivocarse menos y no usar Visual Basic"
Atte.
Victor Yañez
Apoyen el Proyecto OpenSource del Club Builder. Ya tenemos componentes Listos!!! |
|
| Volver arriba |
|
 |
lila Cdt

Registrado: 30 Nov 2003Mensajes: 8
|
Publicado: Mie 03 Dic, 2003 3:22 am Asunto: gracias |
|
|
gracias por la ayuda viktor, te pasaste, al parecer sabes mucho de c++ builder.
chaolin |
|
| Volver arriba |
|
 |
_Viktor Master


Registrado: 20 Jul 2003Mensajes: 463Ubicación: Santiago, Los Angeles - Chile
|
|
| Volver arriba |
|
 |
|