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
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
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.