PDA

View Full Version : تشخیص دکمه های موس



dokneh
چهارشنبه 15 آبان 1387, 23:09 عصر
type
B1: TButton;


procedure TForm1.Button1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Shift = [ssLeft,ssShift] then
B1.Caption:='Left Shift'
else if Shift = [ssLeft,ssCtrl] then
B1.Caption:='Left Ctrl'
else if Shift = [ssLeft,ssAlt] then
B1.Caption:='Left Alt'
else if Shift = [ssLeft] then
B1.Caption:='Left'
else if Shift = [ssRight,ssShift] then
B1.Caption:='Right Shift'
else if Shift = [ssRight,ssCtrl] then
B1.Caption:='Right Ctrl'
else if Shift = [ssRight,ssAlt] then
B1.Caption:='Right Alt'
else if Shift = [ssRight] then
B1.Caption:='Right';
end;

vcldeveloper
پنج شنبه 16 آبان 1387, 12:11 عصر
اینطور مطالب را در تاپیک "نکات برنامه نویسی دلفی" اضافه کنید، نه در تاپیک جدید.

با تشکر