「hmV8」の例題 FormやGUIのコンポーネント概要普段C#を利用している方は、.NET Frameworkが非クラスで利用できることを失念しているかもしれません。 非クラスでのフォームの実装#JS = loaddll( hidemarudir + @"\hmV8.dll" ); // フォーム、フォント、クリックする度にラベル生成 #_ = dllfuncw(#JS, "DoString", R"JS( let LibForms = host.lib("System.Windows.Forms"); let LibDrawing = host.lib("System.Drawing"); let form = new LibForms.System.Windows.Forms.Form(); let font = new LibDrawing.System.Drawing.Font("MS Gothic", 15); form.Text = "非クラスでのフォーム"; function form_OnClick(sender, event) { let l = new LibForms.System.Windows.Forms.Label(); l.Text = "Hello"; l.AutoSize = true; l.Location = event.Location; l.Font = font; sender.Controls.Add(l); } form.Click.connect(form_OnClick); LibForms.System.Windows.Forms.Application.Run(form) )JS" ); // 解放 freedll(#JS); ![]() |