请问有谁知道如何屏蔽memo控件中所有的鼠标事件吗?(memo控件不会对鼠标的单击双击等事件作出反应。)
解决方案 »
- delphi现在是不是不能用indy控件开发邮件发送系统了?
- 请大家看看这个程序是什么原因导致运算的错误!
- 如何才能把memo里的文字自动转成txt文件哪?
- 请问:VB和Delphi有什么不同??
- 一张表里数据过多,想设计一张备份表,不知道是不是能提高修改,新增的效率
- 痛苦!报表控件FastReport
- 一个很简单的动态生成控件问题,麻烦各位进来帮帮忙哟,小妹在线等待!
- 有关delphi中的调试问题(在delphi中有没有象vb哪样的即使窗口).送分
- 各位大虾,进来看看,用分换心得呀!
- 请教高手!!!! 请进
- 有没有什么办法禁掉adoquery的自动post功能
- 请教“关于SQL SERVER图像字段的SQL语法”
// Import BlockInput function form user32.dll: // BlockInput Funktion von user32.dll importieren: function BlockInput (fBlockInput : boolean) : DWord; stdcall; external 'user32.DLL'; {block input/ blockieren} procedure TForm1.Button1Click(Sender: TObject);
begin
BlockInput(true);
end; {unblock input / Blockierung aufheben} procedure TForm1.Button2Click(Sender: TObject);
begin
BlockInput(false);
end; Note: Requires Windows 98/2000 or later. You can unblock input by pressing CTRL+ALT+DEL
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TForm1 = class(TForm)
Memo1: TMemo;
Button2: TButton;
Button1: TButton;
Edit1: TEdit;
procedure Memo1Enter(Sender: TObject);
procedure Memo1Exit(Sender: TObject); private
{ Private declarations }
public
{ Public declarations } end;var
Form1: TForm1;
function BlockInput (fBlockInput : boolean) : DWord; stdcall; external 'user32.DLL';
implementation{$R *.DFM}procedure TForm1.Memo1Enter(Sender: TObject);
begin
BlockInput(true)
end;procedure TForm1.Memo1Exit(Sender: TObject);
begin
BlockInput(false)
end;end.
begin
if message.msg=wm_mousemove then
begin
cursor:=crarrow;
exit;
end;
if message.msg=wm_setfocus then
exit;
if message.Msg=wm_lbuttondown then
showmessage('不能输入文字的了');
inherited wndproc(message);
end;
我是初学者,谢谢!我想把memo控件的所有鼠标事件屏蔽掉,但在其中还是可以输入文字的.
我不知道怎么样才能在Delphi中重载你说的这个函数.
(我的窗体命名为form1,所以我把上面的程序中的tmyedit改为Tform1了)。
后来我把tmyedit改为Tmemo或Tmemo1调试时就出错,可以和我说说怎么样才能捕获有关memo控件的
鼠标消息吗?
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TMemo = class(StdCtrls.TMemo)
protected
procedure WndProc(var Message: TMessage); override;
end;type
TForm1 = class(TForm)
Memo1: TMemo;
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TMemo.WndProc(var Message: TMessage);
begin
if (Message.Msg >= WM_MOUSEFIRST) and (Message.Msg <= WM_MOUSELAST) then Exit;
inherited WndProc(Message);
end;end.