Solved

Colored boxes in RadioGroup

Posted on 1998-06-22
2
255 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 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

15 Experts available now in Live!

Get 1:1 Help Now