I'm showing a form but... lazarus / 8-Other ---------------------------------------------------------------------- Anonymous · 2004-02-25 02:30 in my program when i click a button it shows a form (form2.show;), but thats it.. the form doesnt activate itself (it should add items to a combobox).. how do i make the form do what its supposed to? i tried the same thing in delphi, and it worked.... whats the deal? ---------------------------------------------------------------------- neli · 2004-02-25 08:23 What event are you using to 'activate'? The OnFormShow event should work. Micha. ---------------------------------------------------------------------- Anonymous · 2004-02-25 16:52 That doesnt work either... in less my combobox code is wrong.. isnt this how you add stuff to the combobox? combobox1.items.add('stuff'); ---------------------------------------------------------------------- neli · 2004-02-26 23:01 Hmm. What I'd do is putting a ShowMessage or WriteLn in that FormShow function, so you're sure if it's called or not. If it's not while it should, add a bug report . Micha. ---------------------------------------------------------------------- Anonymous · 2004-03-09 17:54 i downloaded the lastest version and it still doesnt work... can someone please try to have 2 forms and a button on the first one and a combobox on the second? the first one should open the 2nd form which adds items to the combobox. and then post the example here? ---------------------------------------------------------------------- Drewski · 2004-03-09 21:44 Sorry for the long post. Here's what I tried hope this helps: Added a button to Form1. Added another Form to the project. (Form2) Added a ComboBox to Form2.  Here's the complete code  //// begin unit1 unit unit1; {$mode objfpc}{$H+} interface uses   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons; type   TForm1 = class(TForm)     Button1: TButton;     procedure Button1Click(Sender: TObject);   private     { private declarations }   public     { public declarations }   end; var   Form1: TForm1; implementation uses unit2; { TForm1 } procedure TForm1.Button1Click(Sender: TObject); var Count: Integer; begin   //Form2.Show;       // Did work if Form2 wasn't visible. Triggered the                       // OnShow Event the first time only.   //Form2.Activate;   // Didn't seem to do anything. Did trigger the                       // OnActivate Event each time but focus was not changed.   // This is crude but it worked, and triggered the OnShow Event each time.   Form2.Visible := False;   Form2.Visible := True; end; initialization   {$I unit1.lrs} end. //// end unit1 //// begin unit2 unit unit2; {$mode objfpc}{$H+} interface uses   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls; type   TForm2 = class(TForm)     ComboBox1: TComboBox;     procedure Form2Show(Sender: TObject);   private     { private declarations }   public     { public declarations }   end; var   Form2: TForm2; implementation { TForm2 } procedure TForm2.Form2Show(Sender: TObject); var Count: Integer; begin   Count := ComboBox1.Items.Count + 1;   ComboBox1.Items.Add('Item' + IntToStr(Count)); end; initialization   {$I unit2.lrs} end. //// end unit2