?
Solved

Allow User To Design At Runtime...

Posted on 1998-09-11
6
Medium Priority
?
138 Views
Last Modified: 2010-04-03
I need to allow the user to design the form at runtime.  ie.  add a edit box or move a label.  Would like to be able to allow user to link dbedit boxes to columns that they design.  The part I really need help with is just allowing them to set the form up like they would like AND save it so it will come back up the next time the app is called...
0
Comment
Question by:MichaelB2
  • 3
  • 3
6 Comments
 
LVL 10

Accepted Solution

by:
viktornet earned 200 total points
ID: 1339482
To move a control use

NameOfControl.Perform(WM_SYSCOMMAND, $f012, 0);

To create at run time use this......

var
  Btn : TButton;
begin
  Btn := TButton.Create(self);
  with Btn do
    begin
      Parent := Self;
      Left := 100;
      Top := 100;
      Width := 100;
      Height := 30;
      Caption := 'Dynamic-Creation...';
      Visible := True;
    end;
end;

Regards,
Viktor Ivanov
0
 

Author Comment

by:MichaelB2
ID: 1339483
This May Be A Dumb Question, But Where Do I Put The:

NameOfControl.Perform(WM_SYSCOMMAND, $f012, 0);
0
 

Author Comment

by:MichaelB2
ID: 1339484
This May Be A Dumb Question, But Where Do I Put The:

NameOfControl.Perform(WM_SYSCOMMAND, $f012, 0);
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:viktornet
ID: 1339485
Here is a complete example.....
------
public
//Declare a procedure for out Button's OnMouseMove()
    procedure MagicMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}
//implement the code used by the proedure
procedure TForm1.MagicMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
begin
  if ssLeft in Shift then
  begin
    ReleaseCapture;
    TControl(Sender).Perform(WM_SYSCOMMAND, $f012, 0);
  end;
end;
//form's OnCreate()
procedure TForm1.FormCreate(Sender: TObject);
var
     Btn : TButton;
   begin
     Btn := TButton.Create(self);
     with Btn do
       begin
         Parent := Self;
         Left := 100;
         Top := 100;
         Width := 100;
         Height := 30;
         Caption := 'Dynamic-Creation...';
         OnMouseMove := MagicMouseMove;//Assign our event
         Visible := True;
       end;
   end;
-------
Regards,
Viktor Ivanov
0
 

Author Comment

by:MichaelB2
ID: 1339486
Thanks!
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1339487
No prob :-)

Regards,
Viktor Ivanov
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question