- 积分
- 5450
- 明经币
- 个
- 注册时间
- 2013-7-3
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2024-10-31 20:48:10
|
显示全部楼层
非常感谢兄弟一再指导,麻烦帮我修改一下,谢谢!
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.AutoCAD.Runtime;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using Autodesk.AutoCAD.DatabaseServices;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
namespace ModelessDlg
{
public class Class1
{
[CommandMethod("LoadWin")]
static public void LoadWin()
{
FormMain MyForm = new FormMain();
MyForm.Show();
MyForm.TextBox1.Text = "001";
MyForm.TextBox2.Text = "002";
}
[LispFunction("GetVal")]
public static ResultBuffer GetVal(ResultBuffer resBufIn)
{
FormMain MyForm = new FormMain();
return new ResultBuffer(new TypedValue((int)LispDataType.Int32, MyForm.TextBox1.Text));
}
}
}
namespace ModelessDlg
{
partial class FormMain
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.TextBox1 = new System.Windows.Forms.TextBox();
this.TextBox2 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// TextBox1
//
this.TextBox1.Location = new System.Drawing.Point(99, 12);
this.TextBox1.Name = "TextBox1";
this.TextBox1.Size = new System.Drawing.Size(100, 21);
this.TextBox1.TabIndex = 0;
this.TextBox1.Text = "123";
//
// TextBox2
//
this.TextBox2.Location = new System.Drawing.Point(99, 60);
this.TextBox2.Name = "TextBox2";
this.TextBox2.Size = new System.Drawing.Size(100, 21);
this.TextBox2.TabIndex = 1;
this.TextBox2.Text = "456";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(37, 15);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(29, 12);
this.label1.TabIndex = 2;
this.label1.Text = "长度";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(37, 60);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(29, 12);
this.label2.TabIndex = 3;
this.label2.Text = "宽度";
//
// FormMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(230, 93);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.TextBox2);
this.Controls.Add(this.TextBox1);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FormMain";
this.Text = "参数";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
public System.Windows.Forms.TextBox TextBox1;
public System.Windows.Forms.TextBox TextBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
}
}
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|