Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2003.10.06;
Скачать: [xml.tar.bz2];

Вниз

Колесо   Найти похожие ветки 

 
Opera   (2003-09-23 01:47) [0]

if Key = VK_DOWN then
begin
if Form1.Panel1.Font.Color=clBlue then
begin
Deselect;
Form1.Panel2.Font.Color:=clBlue
exit;
if Form1.Panel2.Font.Color=clBlue then
begin
Deselect;
Form1.Panel3.Font.Color:=clBlue
exit;

А как сделать тоже самое, но чтобы не по нажатию а когда колесико мышки вниз крутиш?


 
dataMaster   (2003-09-23 03:15) [1]

OnMouseWheelDown или OnMouseWheelUp


 
dataMaster   (2003-09-23 03:33) [2]

Вот примерчик:

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;

type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
P: array [1..3] of TPanel;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
k: byte;
begin
ClientWidth:=120;
ClientHeight:=170;
for k:=1 to 3 do
begin
P[k]:=TPanel.Create(Form1);
with P[k] do begin
Parent:=Form1;
Width:=100;
Height:=50;
Left:=10;
Top:=k*Height-40;
Caption:="Panel"+IntToStr(k);
end;
end;
P[1].Font.Color:=clRed;
P[2].Font.Color:=clBlue;
P[3].Font.Color:=clBlue;
end;

procedure TForm1.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
begin
if P[1].Font.Color=clRed then
begin
P[1].Font.Color:=clBlue;
P[2].Font.Color:=clRed;
Exit;
end;
if P[2].Font.Color=clRed then
begin
P[2].Font.Color:=clBlue;
P[3].Font.Color:=clRed;
Exit;
end;
if P[3].Font.Color=clRed then
begin
P[3].Font.Color:=clBlue;
P[1].Font.Color:=clRed;
end;
end;

end.


:-)



Страницы: 1 вся ветка

Форум: "Основная";
Текущий архив: 2003.10.06;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.01 c
3-18234
P0tia
2003-09-16 21:43
2003.10.06
Как проверить?


1-18455
alex-ran
2003-09-24 11:12
2003.10.06
Ограничение на количество компонентов дочерней формы?


14-18633
Knight
2003-09-17 10:46
2003.10.06
Как вы относитесь к попапам?


6-18500
danatelo
2003-08-07 22:25
2003.10.06
Отправка почты


3-18276
k_len
2003-09-15 12:34
2003.10.06
Базы данных





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский