I would like to know how I can add a scroll bar to a popup menu in delphi that contains many elements.
if Copy(trama, 1, 3) = 'ICO' then
begin
Inc(histo_hq);
j := 1;
for k := 1 to Length(trama) do
begin
if (Copy(trama, k, 1) = '|') then
begin
deli[j] := k;
Inc(j);
end;
end;
try
menuItem_auxstate := TMenuItem.Create(PM_new_status);
menuItem_auxstate.OnClick := PopupItemClick;
menuItem_auxstate.ImageIndex := -1;
menuItem_auxstate.Caption := trim(Copy(trama, deli[2] + 1, deli[3] - deli[2] - 1));
menuItem_auxstate.Tag := strtoint(trim(Copy(trama, deli[3] + 1, deli[4] - deli[3] - 1)));
PM_new_status.Items.Add(menuItem_auxstate);
new_agent_status[histo_hq, 1] := trim(Copy(trama, deli[1] + 1, deli[2] - deli[1] - 1));
new_agent_status[histo_hq, 2] := trim(Copy(trama, deli[2] + 1, deli[3] - deli[2] - 1));
new_agent_status[histo_hq, 3] := trim(Copy(trama, deli[3] + 1, deli[4] - deli[3] - 1));
except
end;
Panel_top.Enabled := True;
end;
the reason is that my menu overflows, and some options cannot be seen on screens.
thank you.