Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

new bordericon on forms

47 views
Skip to first unread message

Andre Jacobs

unread,
Nov 12, 1998, 3:00:00 AM11/12/98
to
Hi, I have this problem that I want to add a bordericon on a form like the
Help icon. So obviously I have to derive something from the tcustomform but
not having ever changed the look of a vcl I dont know how!

I also see that there is a bordericon set in forms.pas but it is not
possible to override that is it? I dont want to change forms.pas unless I
absolutely have to.

please help this desperate man, and just point me in the right direction.

Thanks!
Andre

Yorai Aminov (TeamB)

unread,
Nov 12, 1998, 3:00:00 AM11/12/98
to
On Thu, 12 Nov 1998 11:03:08 +0200, "Andre Jacobs"
<an...@ccs-software.co.za> wrote:

>Hi, I have this problem that I want to add a bordericon on a form like the
>Help icon.

The caption bar icons are drawn and maintained by Windows. The VCL has
nothing to do with their apearance, so overriding TCustomForm won't
help you. The BorderIcons property allows you to select which of the
standard buttons are displayed.

To place additional buttons on the caption, you have to handle
non-client messages, such as WM_NCPAINT and WM_NCLBUTTONDOWN, which
are sent when a window needs its non-client area (such as the caption
bar and borders) repainted, and when the user clicks that area.

You can download TCaptionControl from my page (see signature), which
allows you to place custom buttons on the caption bar. Full source is
provided, so you can modify the code to your needs.

---
Yorai Aminov (TeamB)
http://ourworld.compuserve.com/homepages/yaminov
(TeamB cannot answer questions received via email.
To contact me for any other reason remove nospam from my address)

Srinivasa Bhaskara

unread,
Nov 12, 1998, 3:00:00 AM11/12/98
to
Hi,
Andre Jacobs wrote in message <72e86i$b2...@forums.borland.com>...

>Hi, I have this problem that I want to add a bordericon on a form like the
>Help icon. So obviously I have to derive something from the tcustomform but
>not having ever changed the look of a vcl I dont know how!
>
You dont need to derive from TCustomForm (unless you want to add properties
or methods etc) to get another icon on the caption.

>I also see that there is a bordericon set in forms.pas but it is not
>possible to override that is it? I dont want to change forms.pas unless I
>absolutely have to.
>

In order for you to get another icon up there, you would need to override
the WM_NCPAINT message and actually paint the icon yourself. Thats the only
way to do it.

I think there are some components available which do it, you can check up
one of the Delphi sites for it. Those components would also be trapping the
WM_NCPAINT message of the form, inorder to paint it.

HTH

--
Srinivasa Bhaskara
Agni Software
Home to Hawk Eye - Delphi's first Component Debugger, and other debugging
aids
http://www.agnisoft.com


Andre Jacobs

unread,
Nov 13, 1998, 3:00:00 AM11/13/98
to
Thank you thank you thank you!
I am getting that right now.

Yorai Aminov (TeamB) wrote in message
<364aafce....@forums.inprise.com>...


>On Thu, 12 Nov 1998 11:03:08 +0200, "Andre Jacobs"
><an...@ccs-software.co.za> wrote:

...

Brett Liddicoet

unread,
Nov 20, 1998, 3:00:00 AM11/20/98
to
Give our oxForm component a try. You can download it from our web site along
with many other components.

http://www.opaquesoftware.com/download/delphi4/oxform.exe

Thanks, Brett
Opaque Software
http://www.opaquesoftware.com

Andre Jacobs wrote in message <72e86i$b2...@forums.borland.com>...
>Hi, I have this problem that I want to add a bordericon on a form like the
>Help icon. So obviously I have to derive something from the tcustomform but
>not having ever changed the look of a vcl I dont know how!
>

>I also see that there is a bordericon set in forms.pas but it is not
>possible to override that is it? I dont want to change forms.pas unless I
>absolutely have to.
>

0 new messages