Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Allow User To Design At Runtime...

Posted on 1998-09-11
6
Medium Priority
?
136 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

609 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