Solved

Allow User To Design At Runtime...

Posted on 1998-09-11
6
131 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 50 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LAN or WAN ? 11 95
how to send memory stream from ics Client To ics server ? 11 135
Multiple image collision 13 80
Base1 Encode/Decode 3 81
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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

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