Jump to content
357mag

Looking for a certain component

Recommended Posts

I'm using a regular Label currently to store the sum of some addition, but the book I'm working out of shows the Label sunken in a little bit. It's not perfectly flat like a regular Label is. It has a real shallow depression in it. What is the name of this control?

Share this post


Link to post
13 minutes ago, 357mag said:

What is the name of this control?

It's not a standard control. It was a style that was popular in the nineties (where it belongs).

 

The Raize controls (now Konopka Signature VCL Controls) or the JVCL probably has a label that can paint like that.

Share this post


Link to post
2 hours ago, 357mag said:

What is the name of this control?

You can use a standard TPanel, simply adjust its BevelInner and BevelOuter properties to mimic the sunken look you want.  And, you can assign text to a TPanel like you can with a TLabel (or, just put a TLabel on the TPanel).

Edited by Remy Lebeau

Share this post


Link to post

Cosmetics aside, you should not store values in (visual) components. Store values in variables, class members or a database... not in a visual component. That is not its purpose. Try to avoid misuse of objects. For very small projects this might be OK. But overall and in real life this is not a way to go.

Share this post


Link to post
15 hours ago, 357mag said:

I'm using a regular Label currently to store the sum of some addition, but the book I'm working out of shows the Label sunken in a little bit. It's not perfectly flat like a regular Label is. It has a real shallow depression in it. What is the name of this control?

Maybe it's a TStaticText? That one has got Bevel-options.

Edited by dummzeuch

Share this post


Link to post
7 hours ago, Sherlock said:

Cosmetics aside, you should not store values in (visual) components. Store values in variables, class members or a database... not in a visual component. That is not its purpose. Try to avoid misuse of objects. For very small projects this might be OK. But overall and in real life this is not a way to go.

Explain how else you display a sum to the user, without displaying the data in a control  This will be good to learn.

Share this post


Link to post
1 hour ago, ToddFrankson said:

Explain how else you display a sum to the user, without displaying the data in a control  This will be good to learn.

This may just be a semantic issue. The OP wrote he was "storing" the sum in a label, maybe he meant display. @Anders Melander is correct, data should be stored in variables/fields etc. Of course, if you need to display to the user, some UI control is needed. I have seen too much code where some value was actually stored in a UI control, and the only way to get the current state of that value was to reference the UI control. That is bad.

Share this post


Link to post
52 minutes ago, Dave Novo said:


@Anders Melander is correct, data should be stored in variables/fields etc.

The style I was referring to was the visual style and I assumed that the OP meant something like this:

image.png.f8c8ead3c114af06e9b6bc3e714bb3d0.png

 

Unfortunately he is apparently too busy to respond so we can only guess.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×