Solved

Colored boxes in RadioGroup

Posted on 1998-06-22
2
261 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
[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
  • 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

Industry Leaders: 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month6 days, 17 hours left to enroll

623 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