Results 1 to 8 of 8

Thread: how do i make a black background in forms?

  1. #1
    Join Date
    Dec 2006
    Posts
    2,244
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default how do i make a black background in forms?

    well in my forms i want the writeing to be on a black background how do i do this?

  2. #2
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Like this?
    SCAR Code:
    program New;
    var
      Form : TForm;
      Button : TButton;
      PickThaColor : TColorPicker;
      Edit : TEdit;
    Procedure WriteThaColor(Sender: TObject; Color, X, Y: Integer);
    begin;
      WriteLn('Color Picked: '+inttostr(Color) +' at ('+inttostr(x) + ', '+inttostr(Y) + ')');
    end;
    procedure OnClick(Sender: TObject);
    begin;
      PickThaColor.Pick;
    end;
    Procedure SafeStart;
    begin;

       Form := CreateForm;
       Form.SetBounds(50,50,250,250);
    //   Form.Color := 0;

       Button := TButton.Create(form);
       Button.Parent := Form;
       Button.OnClick := @OnClick;
       Button.Caption := 'Color picker please?';
       Button.SetBounds(75,75,150,25);
       Edit := TEdit.Create(Form);
       Edit.SetBounds(50,50,150,50);
       Edit.Parent := Form;
       Edit.Color := 0;
       Edit.Font.Color := clwhite;
       PickThaColor := TColorPicker.Create(form);
       PickThaColor.OnPick := @WriteThaColor;
       Form.ShowModal;
    end;
    Procedure LoadMe;
    var
      V : TVariantArray;
    begin;
      Try
        ThreadSafeCall('safestart',v);
      except
      end;
    end;
    begin
    LoadMe;
    end.
    Verrekte Koekwous

  3. #3
    Join Date
    Dec 2006
    Posts
    2,244
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ermm isnt that hte color picker in my other thread?

  4. #4
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by RudeBoiAlex View Post
    ermm isnt that hte color picker in my other thread?
    Yeah, was to lazy to make a new form, just run it... And see the edit box with black background .
    Verrekte Koekwous

  5. #5
    Join Date
    Dec 2006
    Posts
    2,244
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok ty

    EDIT: 2 questins

    1) i want a black ground for the whole of the form how i do that ?

    2) when i pick the color how do i make it go into the edit box?

    ty

  6. #6
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by RudeBoiAlex View Post
    ok ty

    EDIT: 2 questins

    1) i want a black ground for the whole of the form how i do that ?

    2) when i pick the color how do i make it go into the edit box?

    ty
    Here you go:
    SCAR Code:
    program New;
    var
      Form : TForm;
      Button : TButton;
      PickThaColor : TColorPicker;
      Edit : TEdit;
    Procedure WriteThaColor(Sender: TObject; Color, X, Y: Integer);
    begin;
      WriteLn('Color Picked: '+inttostr(Color) +' at ('+inttostr(x) + ', '+inttostr(Y) + ')');
      Edit.Text := inttostr(Color);
    end;
    procedure OnClick(Sender: TObject);
    begin;
      PickThaColor.Pick;
    end;
    Procedure SafeStart;
    begin;

       Form := CreateForm;
       Form.SetBounds(50,50,250,250);
       Form.Color := 0;

       Button := TButton.Create(form);
       Button.Parent := Form;
       Button.OnClick := @OnClick;
       Button.Caption := 'Color picker please?';
       Button.SetBounds(75,75,150,25);
       Edit := TEdit.Create(Form);
       Edit.SetBounds(50,50,150,50);
       Edit.Parent := Form;
    //   Edit.Color := 0;
     //  Edit.Font.Color := clwhite;
       PickThaColor := TColorPicker.Create(form);
       PickThaColor.OnPick := @WriteThaColor;
       Form.ShowModal;
    end;
    Procedure LoadMe;
    var
      V : TVariantArray;
    begin;
      Try
        ThreadSafeCall('safestart',v);
      except
      end;
    end;
    begin
    LoadMe;
    end.
    Verrekte Koekwous

  7. #7
    Join Date
    Dec 2006
    Posts
    2,244
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks man + rep

  8. #8
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Your welcome.
    Verrekte Koekwous

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Procedure in the Background
    By FortAsh in forum OSR Help
    Replies: 16
    Last Post: 01-26-2009, 02:58 PM
  2. Background in forms?
    By geerhedd in forum OSR Help
    Replies: 2
    Last Post: 05-23-2007, 02:30 AM
  3. Scar working in the background ?
    By SubiN in forum News and General
    Replies: 4
    Last Post: 06-11-2006, 04:09 AM
  4. Runescape Page Background
    By leader in forum RuneScape News and General
    Replies: 2
    Last Post: 05-31-2006, 02:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •