Solved

Colored boxes in RadioGroup

Posted on 1998-06-22
2
256 Views
Last Modified: 2010-04-04
Hi,

I have a radiogroup in which my users must be able to select a combination of three colors. They can choose out of 6 combinations. (RGB,GBR,BGR,RBG,GRB,BRG). I want each option to show up as a row of three little squares,each in 1 color.
What is the best way to do this? I can make 6 little bitmaps and show them in the radiogroup or maybe paint them on a canvas or something. Any suggestions?

Thanks.
0
Comment
Question by:lizzzard
  • 2
2 Comments
 
LVL 3

Accepted Solution

by:
vladika earned 100 total points
ID: 1355224
Use Shape and set Brush and Pen properties as you want.


0
 
LVL 3

Expert Comment

by:vladika
ID: 1355225
Use TGroupBox and TRadioButtons instead of TRadioGroup
Here is small example

object Form1: TForm1
  Left = 200
  Top = 108
  Width = 167
  Height = 128
  Caption = 'Form1'
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  PixelsPerInch = 96
  TextHeight = 13
  object ColorGroup: TGroupBox
    Left = 8
    Top = 8
    Width = 137
    Height = 81
    Caption = 'ColorGroup'
    TabOrder = 0
    object Shape1: TShape
      Left = 64
      Top = 24
      Width = 17
      Height = 17
      Brush.Color = clRed
    end
    object Shape2: TShape
      Left = 80
      Top = 24
      Width = 17
      Height = 17
      Brush.Color = clGreen
    end
    object Shape3: TShape
      Left = 96
      Top = 24
      Width = 17
      Height = 17
      Brush.Color = clBlue
    end
    object Shape8: TShape
      Left = 96
      Top = 48
      Width = 17
      Height = 17
      Brush.Color = clRed
    end
    object Shape9: TShape
      Left = 64
      Top = 48
      Width = 17
      Height = 17
      Brush.Color = clGreen
    end
    object Shape14: TShape
      Left = 80
      Top = 48
      Width = 17
      Height = 17
      Brush.Color = clBlue
    end
    object RGBBtn: TRadioButton
      Left = 8
      Top = 24
      Width = 50
      Height = 17
      Caption = 'RGB'
      TabOrder = 0
    end
    object GBRBtn: TRadioButton
      Left = 8
      Top = 48
      Width = 50
      Height = 17
      Caption = 'GBR'
      TabOrder = 1
    end
  end
end
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now