Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2017, 10:26 AM
lexd lexd is offline
Senior Member
 
Join Date: Feb 2015
Posts: 250
Default Make a customized form visible on screen

I made a customized form with out a title area

procedure THeadlessForm.CreateParams(var Params: TCreateParams);
begin
Params.Style := Params.Style or WS_THICKFRAME;
end;

Now I want to display it on the screen with a StringGrid

procedure TForm1.FormCreate(Sender: TObject);
begin
HeadlessForm := THeadlessForm.Create(nil); // not linked to application
Grid := TStringGrid.Create(HeadlessForm);
Grid.Parent := HeadlessForm;
HeadlessForm.ActiveControl := Grid;
HeadlessForm.Visible := True;
SetWindowPos(HeadlessForm.Handle, Form1.Handle, Form1.Top -5, Form1.Left -5,
Form1.Width -5, Form1.Height -5, HWND_TOPMOST);
BringWindowToTop(HeadlessForm.Handle);
SetForegroundWindow(HeadlessForm.Handle);
B := IsWindowVisible(HeadlessForm.Handle);
Form1.Visible := b; // main form stays visible but no HeadlessForm
end;

what am I doing wrong? as I cannot get it to display the HeadlessForm
Reply With Quote
Reply

Tags
delphi 7

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 06:07 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2017, vBulletin Solutions, Inc.