Jump to content
Fórum Script Brasil
  • 0

Adiciona Horizontal Scrollbar em um ListBox


Question

1.PNG.c1cd135fd5bc933dceeb4bc3d15ca985.PNG

2.PNG.6d14b12889f33139faa1f0a416830968.PNG

//---------------------------------------------------------------------------
//Adiciona Horizontal Scrollbar
void Horizontal_Scrollbar()
{
int A, B;
String C;

  // Encontra o comprimento do item mais longo.
  A = 0;
  for (int i=0; i<Form1->ListBox1->Items->Count; i++)
  {
    C = Form1-> ListBox1-> Items-> Strings[i];
    B = Form1-> ListBox1 -> Canvas-> TextWidth(C);
    if (B > A) A = B;
  }

//Adiciona um pouco mais para um bom efeito visual no listbox.
A += 10;

//Manda o Windows criar a barra de rolagem com o Valor do A
SendMessage(Form1 -> ListBox1 -> Handle, LB_SETHORIZONTALEXTENT, A, 0);
}
//---------------------------------------------------------------------------


 

 

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      148682
    • Total Posts
      644515
×
×
  • Create New...