Results 1 to 5 of 5

Thread: color picker button in forms?

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

    Default color picker button in forms?

    well like in santys autofigter he has a button in his form what says pick then when you click it , it goes to the colorpicker button how do i do this?

  2. #2
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    procedure ThePicker(Sender: TObject);
    begin
        PickColor(x, y, color);
    end;
    Interested in C# and Electrical Engineering? This might interest you.

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

    Default

    Thanks i can work it out form here

  4. #4
    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;
    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);
       

       Button := TButton.Create(form);
       Button.Parent := Form;
       Button.OnClick := @OnClick;
       Button.Caption := 'Color picker please?';
       Button.SetBounds(75,75,150,25);
       
       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

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

    Default

    i had a different idea but that could work

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. auto color picker
    By i 69 ur nan in forum OSR Help
    Replies: 8
    Last Post: 12-04-2008, 09:16 PM
  2. auto color picker
    By i 69 ur nan in forum News and General
    Replies: 3
    Last Post: 11-30-2008, 06:04 PM
  3. Forms Button click!
    By wtf i sp4nk in forum OSR Help
    Replies: 3
    Last Post: 02-09-2007, 02:09 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
  •