FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


C++ Builder6 of Borland rightclick on Listbox with event





gaudi
I´m Programming with
C++ Builder6 of Borland

What is the Code for the rightclick on Listbox.

Thanks
gaudi
I found it out by my self again.

void __fastcall TForm1::ListBox1MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
TPoint point;

if(Button==mbRight)
{
int Index = ListBox1->ItemAtPos(Point(X,Y), true);
ListBox1->ItemIndex=Index;
Edit1->Text = Index;
Edit2->Text = "Right";
Edit3->Text=ListBox1->Items->Strings[ListBox1->ItemIndex];
}

if(Button==mbLeft)
{
int Index = ListBox1->ItemAtPos(Point(X,Y), true);
ListBox1->ItemIndex=Index;
Edit1->Text = Index;
Edit2->Text = "Left";
Edit3->Text=ListBox1->Items->Strings[ListBox1->ItemIndex];
}

}
gaudi
void __fastcall TForm1::ListBox1MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
TPoint point;

if(Button==mbRight)
{
int Index = ListBox1->ItemAtPos(Point(X,Y), true);
ListBox1->ItemIndex=Index;
Edit1->Text = Index;
Edit2->Text = "Right";
Edit3->Text=ListBox1->Items->Strings[ListBox1->ItemIndex];
}

if(Button==mbLeft)
{
int Index = ListBox1->ItemAtPos(Point(X,Y), true);
ListBox1->ItemIndex=Index;
Edit1->Text = Index;
Edit2->Text = "Left";
Edit3->Text=ListBox1->Items->Strings[ListBox1->ItemIndex];
}

if(Button==mbMiddle)
{
int Index = ListBox1->ItemAtPos(Point(X,Y), true);
ListBox1->ItemIndex=Index;
Edit1->Text = Index;
Edit2->Text = "Middle";
Edit3->Text=ListBox1->Items->Strings[ListBox1->ItemIndex];
}

}
Related topics
Funny C variable
C++ Microsoft Access Database
C++ (how to make a game)
Need help in Borland C++ 3.0
C++
Which C++ IDE do you use?
C++, simple things???
which one programming lanuge result's the best speed
PHP VS ASP
XML with C++
c++ newbie problem
PROGRAMAÇÃO
Wheel Mouse with Borland Builder C++
Menu Change Caption with C++ Builder6
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.