Solved

Allow User To Design At Runtime...

Posted on 1998-09-11
6
128 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now