Solved

How to assign Glyph Icon for new component

Posted on 1998-12-03
6
377 Views
Last Modified: 2013-12-03
Hi folks,

I am trying to create a new (simple) Component.  It consists of a small pannel with 3 buttons I often use on my form.  They do some simple filtering on my Datasources, nothing complicated.

But now I'm having a little problem.  It seems that crating the pannel and the buttons is no problem, but when I place my new component on a form, the buttons have no glyphs or bitmaps attached to them.

Now I would like to ask how I can attach an image to the three buttons, which will appear on my form when I place my new control on my form.

Anyone has any hints concerning this ?

Thanks a lot in advance
0
Comment
Question by:Stefaan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 50 total points
ID: 1349237
Create a .RES file for the component which contains three bitmaps for the buttons. Include the res file in the component source like this:

{$R TheBitmaps.RES}

In the constructor for the component do this;

BitBtn1.glyph.LoadFromResourceName(Application.Handle, 'BitBtn1Glyph');
BitBtn2.glyph.LoadFromResourceName(Application.Handle, 'BitBtn2Glyph');
BitBtn3.glyph.LoadFromResourceName(Application.Handle, 'BitBtn3Glyph');

Cheers,

Raymond.

0
 
LVL 3

Author Comment

by:Stefaan
ID: 1349238
Hi rwilson,

You were absolutely Right.  It works perfectly.  One little question I still want to ask is : What is the default (most used) size of a speedbutton and the icon which is on it.

I have made my button 26 x 26 and the icon on it is 21 x 21.  Is this good, or should I take something else.

Oh, by the way, if you have any more usefull tips or links concerning Component Creation, feel free to send them to me.

Greetings and best regards,


Stefaan Lesage

E-Mail : Stefaan.Lesage@eca.be

0
 
LVL 3

Author Comment

by:Stefaan
ID: 1349239
Sorry RWilson, forgot to award you with the points.

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:rwilson032697
ID: 1349240
Hi Stefan,

I think most speedbuttons (like the ones you see in toolbars) are 16x16 - not that it really matters since they will be scales but the scaling can sometimes reduce the quality.... Otherwise you can pretty much use whatever size suits your app.

Cheers,

Raymond.
0
 
LVL 3

Author Comment

by:Stefaan
ID: 1349241
Raymond,

I have one more question, which you could probably help me with.  The pannel contains 3 buttons (one for entering a filter, one for applying a filter and one for canceling a filter), but it Should also contain a RadioGroup with 2 radiobuttons one for AND one for OR.

I already found out how I could create the RadioGroup, but apparently I can't seem to figure out how I should create the 2 radiobuttons, and furthermore I would also like to get the currently selected radiobutton as a property (which probable means I'll have to code something into the OnClick event of the radiogroup).

If you have any hints on how I could achieve this.  I would be very greatfull if you could help me.

Thanks a lot in advance.

Greetings and best regards,

Stefaan

0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1349242
Right click on the radio group component - theres an option to add a radiobutton.

The radiogroup component has a property indicating the selected radio button in the group.

Cheers,

Raymond.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question