Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounded button suggestion

Status
Not open for further replies.

paulsv

Programmer
Jun 29, 2007
16
GB
Can anyone recommend a rounded rectangle button component to use? What I want to do is to display a set of buttons on a panel displaying a background image. I want to be able to load an image for each button and then have a caption appear on top. I have found components which do this but they don't deal with the rounding properly - I want to see the background image appear in the corners. I also don't want to have a border or bevel - I will deal with this in the button image.

I have looked at the TAdvGlassButton from TMS and this gives the sort of effect I want, but I really want a darker look and no border - the glass button appears too pale because it is transparent and there is no control over this.

Any suggestions much appreciated.

Paul
 
If you want I'll send you my tGraphicButton component (made in D5, but it will work for you). It uses only image(s) to display itself --so you have absolute control over what the button looks like in normal, hover, active, and disabled states.
 
That would be great :) How do I PM you? (sorry if I'm being thick).
 
Here you go. It is a D3+ package.

Files
[tab]tGraphicButton.dpk
[tab]tGraphicButton.res
[tab]uGraphicButton.pas

[tab]tGraphicButton.cnt
[tab]tGraphicButton.hlp

Compilation and Installation
From the Delphi IDE, load the DPK file. Click Compile and then Install. You should see a new tab on the component palette named Dúthomhas, with GraphicButton on it. (If you don't like that, you can move it around using the Component Palette Editor. Also, if you are using one of the Turbo Express versions, you cannot install new components. I don't know if you can actually compile them or not... [sub]as I haven't yet tried that with 2006 Express[/sub]).

Next, make sure you Save Changes. This will give you the [tt]uGraphicButton.dcu[/tt] file in the same directory as the DPK file. You will want to copy this DCU file (starting with [tt]u[/tt], not [tt]t[/tt]) to your Delphi\BDS Lib directory (or where ever it is you like to keep foreign DCUs). Delphi needs this DCU to directly link the GraphicButton into an EXE (otherwise you would be stuck having to 'Build with Runtime Packages' in order to use it).

Final Notes
I never intended to distribute this component, hence the documentation does not integrate into the Delphi documentation. (But BDS documentation is a different format anyway...)

I've used this component to good effect, but it is pretty old, and I'm sure it has its limitations.

Well, enjoy!

Oh yeah, I currently don't have any online space of my own [sub](sorry)[/sub] so the attachment links to FileFactory. It will expire in more or less a month. If any one else ever comes along and wants this, just post asking and I'll make it available again.

--Michael
 
 http://www.filefactory.com/file/cbcbf2/n/tGraphicButton-1_0_zip
That should have been 'Thanks Michael' :)
 
You can also check out the JVCL which has several buttons.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top