Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

button trouble

30 views
Skip to first unread message

mark

unread,
Oct 17, 2003, 10:23:40 AM10/17/03
to
Hi need some advice badly!

I am still a novice programmer and can understand the error message but i
dont know how to fix it>

I have an application built in delphi 7 with a TMediPlayer component, I am
trying to set an OnClick event for the btPrev button with the code as below

procedure TMainForm.MediaPlayer1Click(Sender: TObject; Button: TMPBtnType;
var DoDefault: Boolean);
begin
if button = btPrev then
begin
//my code
end;

but when i try to compile the code i get the following error:-

[Error] MainUnit.pas(341): Incompatible types: 'TMPBtnType' and 'TUDBtnType'

I would really aprectiate some coments on how to fix this problem

Regards Mark


John Herbster (TeamB)

unread,
Oct 17, 2003, 11:11:15 AM10/17/03
to

"mark" <cmsm...@livjm.ac.uk> wrote
> I have an application built in Delphi 7 with a TMediPlayer

> component, I am trying to set an OnClick event for the
> btPrev button with the code as below
>
> procedure TMainForm.MediaPlayer1Click(Sender: TObject; Button:
TMPBtnType;
> var DoDefault: Boolean);
> begin
> if button = btPrev then
> begin
> //my code
> end;
>
> but when i try to compile the code i get the following error:-
> [Error] MainUnit.pas(341): Incompatible types: 'TMPBtnType' and
'TUDBtnType'

Mark, If you do some searching in Help for 'TMPBtnType' and
'TUDBtnType' you will find that "btPrev" has at least two definitions.
You need to "qualify" you btPrev with the unit where the definition
you want is defined -- like maybe "MPlayer.btPrev".
Regards, JohnH

Ignacio Vazquez

unread,
Oct 17, 2003, 11:09:42 AM10/17/03
to
"mark" <cmsm...@livjm.ac.uk> wrote in message
3f8f...@newsgroups.borland.com...

> [Error] MainUnit.pas(341): Incompatible types: 'TMPBtnType' and
> 'TUDBtnType'
>
> I would really aprectiate some coments on how to fix this problem

The problem is that both TUpDown and TMediaPlayer have similar definitions
for some buttons (btPrev and btNext). If you want to refer to one of those
buttons for a specific control, then you need to tell it which one be
prefixing it with the unit name (MPlayer in this case), which gives you
MPlayer.btPrev.

Cheers,
Ignacio

--
No, don't send me e-mail directly. No, just don't.


mark

unread,
Oct 17, 2003, 11:46:38 AM10/17/03
to
Ok i got it workin now thanks guys for your help!


0 new messages