Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Insert a Button Inside TListViewItem and Handling OnClick Event...



Permlink Replies: 3 - Last Post: Sep 30, 2016 11:54 PM Last Post By: Ken Randall
Thiago Silva


Posts: 37
Registered: 12/20/04
Insert a Button Inside TListViewItem and Handling OnClick Event...
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 29, 2016 6:09 PM
Hi Eveyone,

I need to insert a button inside TListViewItem. I got using the TListView design mode but I need to implement a button onclick. I tried to use the OnClickItemEx but in Android it does not works correctly do not show the coordinates correctly.

Any suggestions to handle it? I am using Delphi Berlin 10.1

Regards,

Thiago
Ken Randall

Posts: 130
Registered: 11/12/99
Re: Insert a Button Inside TListViewItem and Handling OnClick Event...
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 30, 2016 12:14 AM   in response to: Thiago Silva in response to: Thiago Silva
Thiago Silva wrote:

Hi Eveyone,

I need to insert a button inside TListViewItem. I got using the
TListView design mode but I need to implement a button onclick. I
tried to use the OnClickItemEx but in Android it does not works
correctly do not show the coordinates correctly.

Any suggestions to handle it? I am using Delphi Berlin 10.1

Regards,

Thiago

I use a TextButton and the TListView.OnButtonClick event on all
platforms.
Thiago Silva


Posts: 37
Registered: 12/20/04
Re: Insert a Button Inside TListViewItem and Handling OnClick Event...
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 30, 2016 10:08 AM   in response to: Ken Randall in response to: Ken Randall
Ken Randall wrote:
Thiago Silva wrote:

Hi Eveyone,

I need to insert a button inside TListViewItem. I got using the
TListView design mode but I need to implement a button onclick. I
tried to use the OnClickItemEx but in Android it does not works
correctly do not show the coordinates correctly.

Any suggestions to handle it? I am using Delphi Berlin 10.1

Regards,

Thiago

I use a TextButton and the TListView.OnButtonClick event on all
platforms.

Thank you,

Could you gimme an example? How are you doing it ?

Regards,

Thiago.

Edited by: Thiago Silva on Sep 30, 2016 10:09 AM
Ken Randall

Posts: 130
Registered: 11/12/99
Re: Insert a Button Inside TListViewItem and Handling OnClick Event... [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 30, 2016 11:54 PM   in response to: Thiago Silva in response to: Thiago Silva
Thiago Silva wrote:

Could you gimme an example? How are you doing it ?

If you only have one button then the following is sufficient:

procedure TSimpleListViewDelete.ListView1ButtonClick(const Sender:
TObject; const AItem: TListItem;
const AObject: TListItemSimpleControl);
begin
ShowMessage(ListView1.Items[AItem.Index].Text);
end;
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02