请各位朋友给我一个制作winhelp的帮助工具,我急用。 (200分)

  • 主题发起人 主题发起人 tang125
  • 开始时间 开始时间
T

tang125

Unregistered / Unconfirmed
GUEST, unregistred user!
要求能够支持中文。tangxiangcheng@163.com
 
难道没有一个高手帮我解决问题?高手,高手,你在那?
 
我在这,但我要走了
 
看一下XPMenu的源码
 
可不可以举个例子或方法?
 
如果继承自TGraphicControl的话很简单。 只要重载paint方法, 然后在那里处理即可
如果继承自TButton的话, win2000/xp下很简单, 只要调用SetLayeredWindowAttributes就可实现。
95/98/NT下复杂的多, 而且效果极差。 经常不能正确刷新(而且看起来象是windows的毛病)。
 
有这样控件为什么不去下载,
具体地点我忘记了,你搜一搜吧
 
有现成的控件,到几个delphi网站看看。
 
如果重载Paint 方法的话,原代码怎么写,请举个例子好不好。
 
透明RichEdit(只读)
RichEdit
Transparent RichEdit (just display)
 
"M. Schubert" wrote:
> Is there a way to make a RichEdit-Component transparent, so that only
> the Text ist displayed and the background shines through ?
>
> If not,do
es anybody know a free Component, that cando
this ?
>
> Thanx in advance
>
> Markward
My thanks to Peter Below for this code which allows you to display Rich
Text so that the background shines through. Note that the RichEdit
component itself is not visible - so you cannot edit the text that you
can see.
Hope it helps.
implementation
uses richedit;
{$R *.DFM}
procedure TForm1.Button2Click(Sender: TObject);
var
imagecanvas: TCanvas;
fmt: TFormatRange;
begin
RichEdit1.lines.LoadFromFile('text.rtf');
imagecanvas := image1.canvas;

with fmtdo
begin
hdc:= imagecanvas.handle;
hdcTarget:= hdc;
// rect needs to be specified in twips (1/1440 inch) as unit
rc:= Rect(0, 0,
imagecanvas.cliprect.right * 1440 div pixelsperinch,
imagecanvas.cliprect.bottom * 1440 div pixelsperinch
);
rcPage:= rc;
chrg.cpMin := 0;
chrg.cpMax := richedit1.GetTextLen;
end;

SetBkMode( imagecanvas.Handle, TRANSPARENT );
richedit1.perform( EM_FORMATRANGE, 1, integer( @fmt ));
// next call frees some cached data
richedit1.perform( EM_FORMATRANGE, 0, 0 );
image1.refresh;
// refresh is necessary since the control only refreshes automatically
// if a canvas method is used to change its content.
end;















透明 WinControls
Components
Transparent WinControls
  In article <7kv799$efd8@forums.borland.com>, Robert wrote:
> WMEraseBkgnd message fills the TWincontrol with the brush color of the
> control, that makes the control opaque. Is it posible to make a
> TWincontrol transparent?
Well, you have half the answer: since it is WM_ERASEBKGND that causes
the background fill, trap the message and block it.
Here is my standard reply on this transparent issue:

> Please give me help on how to make a descendent class of TGroupBox
> transparent. Thanks in advance.
Scott,
a quick &amp;
dirty method is
groupbox1.Brush.style := bsclear;
groupbox1.handleneeded;
setwindowlong( groupbox1.handle, GWL_EXSTYLE, WS_EX_TRANSPARENT );
in the forms OnCreate event handler.
Todo
that kind of stuff right, create a new control derived from
TGroupbox, override its CreateParam method like this:
private // in control declaration
Procedure CreateParams( Var params: TCreateParams );
override;
Procedure TTransparentGroupbox.CreateParams( Var params: TCreateParams
);
begin
inherited CreateParams( params );
params.ExStyle := params.ExStyle or WS_EX_TRANSPARENT;
end;

Add a handler for the WM_ERASEBKGND message:
Procedure WMEraseBkGnd( Var msg: TWMEraseBkGnd );
message WM_ERASEBKGND;
Procedure TTransparentGroupbox.WMEraseBkGnd( Var msg: TWMEraseBkGnd );
begin
SetBkMode( msg.DC, TRANSPARENT );
msg.result := 1;
end;

That is the basic frame for a TWinControl descendent. For a
TGraphicsControl you would drop the CreateParams (since only WinControls
have that method) and override the create constructor. After calling the
inherited constructor you modify the ControlStyle of the control:
ControlStyle := ControlStyle - [csOpaque];

Transparency actually works better for TGraphicControls than for
TWinControls. The latter have problems if the control is moved or the
panel) are always created with the WS_CLIPCHILDREN style, which
automatically excludes the area under child controls from updates, so
the background will not be updated if required. Removing the
WS_CLIPCHILDREN style from a controls parent is possible with
SetWindowLong( parent.handle, GWL_STYLE,
GetWIndowLong( parent.handle, GWL_STYLE )
and not WS_CLIPCHILDREN );

But that may lead to accessive flicker on screen updates.


Peter Below (TeamB) 100113.1101@compuserve.com)
No e-mail responses, please, unless explicitly requested!



 
我要求是半透明。请继续给答案。
 
不讨论了吗?我真的很需要呀!
 
把你的Button颜色和底色做异或运算
 
怎样XOR运算,请举例.如果解决,我就要送分了.
 
不用讨论 就用异型窗口就可以了 调用 windows 下窗口的定义方式 思路是这样的
其他 自己找 看书呀 老哥 !!!
 
所谓半透明, 其实就是每个点的背景色*透明度+前景色*(1-透明度)
 
多人接受答案了。
 
后退
顶部