Results 1 to 4 of 4

Thread: Forms help.

  1. #1
    Join Date
    Feb 2006
    Location
    Aussie
    Posts
    937
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Forms help.

    ok, i have looked at the forms tuts in tut island.. but, one thing i don't know, but have really wanted to, is how to use the drop down boxes.. if anyone can teach me, or give me the code, or anything to allow me to add options to it, please grab me on msn, or post here. thanks.

  2. #2
    Join Date
    Feb 2006
    Location
    Australia, NSW.
    Posts
    1,461
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Declaring:
    Code:
    var
      ComboBox1 : TComboBox;
    Script:
    Code:
    ComboBox1 := TComboBox.Create(frmDesign);
    ComboBox1.Parent := frmDesign;
    ComboBox1.Left := 11;
    ComboBox1.Top := 7;
    ComboBox1.Width := 145;
    ComboBox1.Height := 21;
    ComboBox1.ItemHeight := 13;
    ComboBox1.TabOrder := 8;
    ComboBox1.Text := 'ComboBox1';
    Adding an item:
    In the form information:
    Code:
    ComboBox1.Items.Add('Text of next..');
    Finding:
    To find the current text:
    Code:
     writeln(ComboBox1.text);
    Boolean'ing:
    Code:
    if (ComboBox1.text = 'yes') then
      Writeln('True!');
    EXAMPLE:
    Code:
    var
      frmDesign : TForm;
      ComboBox1 : TComboBox;
    
    procedure Say(Sender: TObject);
    begin
      Writeln('Just Chose: ' + ComboBox1.Text);
    end;
    
    procedure InitForm;
    begin
    frmDesign := CreateForm;
    frmDesign.Left := 250;
    frmDesign.Top := 114;
    frmDesign.Width := 696;
    frmDesign.Height := 480;
    frmDesign.Caption := 'frmDesign';
    frmDesign.Color := clBtnFace;
    frmDesign.Font.Color := clWindowText;
    frmDesign.Font.Height := -11;
    frmDesign.Font.Name := 'MS Sans Serif';
    frmDesign.Font.Style := [];
    frmDesign.Visible := false;
    frmDesign.PixelsPerInch := 96;
    ComboBox1 := TComboBox.Create(frmDesign);
    ComboBox1.Parent := frmDesign;
    ComboBox1.Left := 11;
    ComboBox1.Top := 7;
    ComboBox1.Width := 145;
    ComboBox1.Height := 21;
    ComboBox1.ItemHeight := 13;
    ComboBox1.TabOrder := 8;
    ComboBox1.Text := 'ComboBox1';
    ComboBox1.Items.Add('Item1');
    ComboBox1.Items.Add('Item2');
    ComboBox1.Items.Add('Item3');
    ComboBox1.Items.Add('Item4');
    
    ComboBox1.OnChange:= @Say;
    end;
      
    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;
    
    procedure ShowFormModal;
    begin
      frmDesign.ShowModal;
    end;
    
    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;
    
    begin
      SafeInitForm;
      SafeShowFormModal;
    end.
    Anymore questions, just ask

  3. #3
    Join Date
    Feb 2006
    Location
    Aussie
    Posts
    937
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    sweet thanks man, for helping, and also having this as "a special circumstance(sp?)"

    if you are wondering what that means. you post somewhere that you would not post in rs or scar related things, except in special circumstances(sp?)

    BTW, you know how to make a pic as the background, that i would really like to know.

  4. #4
    Join Date
    Feb 2006
    Location
    New Zealand
    Posts
    1,330
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Jagex_Fagex
    sweet thanks man, for helping, and also having this as "a special circumstance(sp?)"

    if you are wondering what that means. you post somewhere that you would not post in rs or scar related things, except in special circumstances(sp?)

    BTW, you know how to make a pic as the background, that i would really like to know.
    Ahhh no it was just runescape related things. But anyways. The best thing is to find a script where it has drop downboxes and a back ground image and learn form there. All i did to start off with mine was just copy and paste half the dropdown menu options from someone elses script then edit it to fit my needs. Then learn on from there

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Forms
    By marre in forum OSR Help
    Replies: 2
    Last Post: 12-19-2007, 07:53 PM
  2. Need help with forms!
    By Da Der Der in forum OSR Help
    Replies: 2
    Last Post: 01-14-2007, 07:13 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
  •