[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

delphi 2005 q, about backgrounds

Posted on 2005-05-11
3
Medium Priority
?
160 Views
Last Modified: 2011-09-20
im a noob to delphi, nd i want to make so in mi program in making that theres a combo box that can change mi forms background with about 5 different backgrounds how would i go about do this
0
Comment
Question by:lukestar234
1 Comment
 

Accepted Solution

by:
alexeijames earned 500 total points
ID: 13976976
drop a combo box into a form.

click on the combobox and populate the ITEMS of the combo box with the following...

red
blue
green
black
white

Then enter this code..............

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    ComboBox1: TComboBox;
    procedure ComboBox1Select(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.ComboBox1Select(Sender: TObject);
var
i:integer;
begin

i:=combobox1.ItemIndex;
case i of
0:form1.Color:= clred;
1:form1.Color:= clblue;
2:form1.Color:= clgreen;
3:form1.Color:= clblack;
4:form1.Color:= clwhite;
end;
end;

end.



regards

JAs
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month20 days, 11 hours left to enroll

864 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