DJK
02-15-2004, 02:29 AM
Hey, I want to do something when I click in a button in the toolbar it opens a url according to what record you selected in the grid below, currently I have this which doesn't work like it should :
procedure TForm1.ToolButton4Click(Sender: TObject);
var
s: string;
begin
if (Column.FieldName = 'Info') then
begin
s := Column.Field.AsString;
if (s <> '') then
ShellExecute(Handle, 'open', PChar(s), nil, nil, SW_SHOW);
end;
end;
This works if you do it directly on "cell click" of the dbgrid, but it should only do it when you click a button 4 on the toolbar ..
Any help appreciated :)
procedure TForm1.ToolButton4Click(Sender: TObject);
var
s: string;
begin
if (Column.FieldName = 'Info') then
begin
s := Column.Field.AsString;
if (s <> '') then
ShellExecute(Handle, 'open', PChar(s), nil, nil, SW_SHOW);
end;
end;
This works if you do it directly on "cell click" of the dbgrid, but it should only do it when you click a button 4 on the toolbar ..
Any help appreciated :)