掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
Edit等をForm上に動的作成し、PGMを実行してないForm上でその情報を反映させるには? (ID:9996)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
> つまり、自動変換ツールみたいなプログラムが作れればな〜 > と思ったんですけど、ソース自体に書き込むのはやはり無理なんですかね? 簡単ではありませんが不可能ではないと思います。 Delphi の RAD では、フォームの定義は *.pas とそれに対応する *.dfm ファイル があれば、完全に記述されます。例えば、Form2 に適当に Edit1 と Label1 を 置いたときの pas ファイルは unit Unit2; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm2 = class(TForm) Edit1: TEdit; Label1: TLabel; private { Private 宣言 } public { Public 宣言 } end; var Form2: TForm2; implementation {$R *.DFM} end. であり、対応する dfm ファイルの内容は object Form2: TForm2 Left = 192 Top = 108 Width = 696 Height = 480 Caption = 'Form2' Color = clBtnFace Font.Charset = SHIFTJIS_CHARSET Font.Color = clWindowText Font.Height = -12 Font.Name = 'MS Pゴシック' Font.Style = [] OldCreateOrder = False PixelsPerInch = 96 TextHeight = 12 object Label1: TLabel Left = 36 Top = 52 Width = 33 Height = 12 Caption = 'Label1' end object Edit1: TEdit Left = 32 Top = 16 Width = 121 Height = 20 TabOrder = 0 Text = 'Edit1' end end です。ですから > (DelphiでいうEdit,Label,Grid等の位置、桁、内容等はファイルで持っている) のファイルを読みとって上のような pas と dfm ファイルを生成するツールをつ くることは出来ると思います。dfm ファイルの内容を研究してみてください。
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.