Forum > LCL

How to set the position of a secondary form below a editbox of the main form?

(1/1)

Jvan:
considering form borders.

jamie:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.EditButton1ButtonClick(Sender: TObject);Var  P:TPoint;begin  P := EditButton1.ClientToScreen(Point(0,0));  Form2.Top := P.Y+EditButton1.Height;  Form2.Left:= P.X;  Form2.Show;end;                        
Implement the OnDeActivate event of the drop down form so that you can set it non visible.
that way it behaves like a drop down and will go away as soon as you change focus to another control

Also I set the second form to have no border so you need to draw the outline of the form too.

Jvan:
Thanks.

Navigation

[0] Message Index

Go to full version