一个简单的代码生成“器”

'// 一个简单的代码生成“器”

'// 在比较大的数据库操作时,对字段操作有好多变量、属性、函数的类似的重复性的大量代码

'// 如果一个个来重写,确是令人烦躁的事,因此自己弄了一个小程序作这部分工作。

Public Class FrmPropertyCode

Inherits System.Windows.Forms.Form

Region " Windows 窗体设计器生成的代码 "

Public Sub New ()

MyBase .New()

' 该调用是 Windows 窗体设计器所必需的。

InitializeComponent()

' 在 InitializeComponent() 调用之后添加任何初始化

Initialize()

End Sub

' 窗体重写 dispose 以清理组件列表。

Protected Overloads Overrides Sub Dispose( ByVal disposing As Boolean )

If disposing Then

If Not (components Is Nothing ) Then

components.Dispose()

End If

End If

MyBase .Dispose(disposing)

End Sub

'Windows 窗体设计器所必需的

Private components As System.ComponentModel.IContainer

' 注意 : 以下过程是 Windows 窗体设计器所必需的

' 可以使用 Windows 窗体设计器修改此过程。

' 不要使用代码编辑器修改它。

Friend WithEvents VariableTextBox As System.Windows.Forms.TextBox

Friend WithEvents CodeTextBox As System.Windows.Forms.TextBox

Friend WithEvents PropertyComboBox As System.Windows.Forms.ComboBox

Friend WithEvents PropertyTextBox As System.Windows.Forms.TextBox

Friend WithEvents SavePropertyButton As System.Windows.Forms.Button

Friend WithEvents BuildCodeButton As System.Windows.Forms.Button

Friend WithEvents Label1 As System.Windows.Forms.Label

Friend WithEvents Label2 As System.Windows.Forms.Label

Friend WithEvents Label3 As System.Windows.Forms.Label

Friend WithEvents Label4 As System.Windows.Forms.Label

  1<system.diagnostics.debuggerstepthrough()> Private  Sub  InitializeComponent() 
  2
  3Dim  resources  As  System.Resources.ResourceManager =  New  System.Resources.ResourceManager(  GetType  (FrmPropertyCode)) 
  4
  5Me  .VariableTextBox =  New  System.Windows.Forms.TextBox 
  6
  7Me  .CodeTextBox =  New  System.Windows.Forms.TextBox 
  8
  9Me  .PropertyComboBox =  New  System.Windows.Forms.ComboBox 
 10
 11Me  .PropertyTextBox =  New  System.Windows.Forms.TextBox 
 12
 13Me  .SavePropertyButton =  New  System.Windows.Forms.Button 
 14
 15Me  .BuildCodeButton =  New  System.Windows.Forms.Button 
 16
 17Me  .Label1 =  New  System.Windows.Forms.Label 
 18
 19Me  .Label2 =  New  System.Windows.Forms.Label 
 20
 21Me  .Label3 =  New  System.Windows.Forms.Label 
 22
 23Me  .Label4 =  New  System.Windows.Forms.Label 
 24
 25Me  .SuspendLayout() 
 26
 27' 
 28
 29'VariableTextBox 
 30
 31' 
 32
 33Me  .VariableTextBox.Anchor =  CType  (((System.Windows.Forms.AnchorStyles.Top  Or  System.Windows.Forms.AnchorStyles.Bottom) _ 
 34
 35Or  System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) 
 36
 37Me  .VariableTextBox.Location =  New  System.Drawing.Point(8, 48) 
 38
 39Me  .VariableTextBox.Multiline =  True 
 40
 41Me  .VariableTextBox.Name = "VariableTextBox" 
 42
 43Me  .VariableTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both 
 44
 45Me  .VariableTextBox.Size =  New  System.Drawing.Size(168, 176) 
 46
 47Me  .VariableTextBox.TabIndex = 0 
 48
 49Me  .VariableTextBox.Text = "" 
 50
 51' 
 52
 53'CodeTextBox 
 54
 55' 
 56
 57Me  .CodeTextBox.Anchor =  CType  ((((System.Windows.Forms.AnchorStyles.Top  Or  System.Windows.Forms.AnchorStyles.Bottom) _ 
 58
 59Or  System.Windows.Forms.AnchorStyles.Left) _ 
 60
 61Or  System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) 
 62
 63Me  .CodeTextBox.BackColor = System.Drawing.SystemColors.Info 
 64
 65Me  .CodeTextBox.Location =  New  System.Drawing.Point(192, 48) 
 66
 67Me  .CodeTextBox.Multiline =  True 
 68
 69Me  .CodeTextBox.Name = "CodeTextBox" 
 70
 71Me  .CodeTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both 
 72
 73Me  .CodeTextBox.Size =  New  System.Drawing.Size(344, 176) 
 74
 75Me  .CodeTextBox.TabIndex = 1 
 76
 77Me  .CodeTextBox.Text = "" 
 78
 79' 
 80
 81'PropertyComboBox 
 82
 83' 
 84
 85Me  .PropertyComboBox.Anchor =  CType  ((System.Windows.Forms.AnchorStyles.Bottom  Or  System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) 
 86
 87Me  .PropertyComboBox.BackColor = System.Drawing.SystemColors.Info 
 88
 89Me  .PropertyComboBox.Location =  New  System.Drawing.Point(88, 240) 
 90
 91Me  .PropertyComboBox.Name = "PropertyComboBox" 
 92
 93Me  .PropertyComboBox.Size =  New  System.Drawing.Size(224, 20) 
 94
 95Me  .PropertyComboBox.TabIndex = 2 
 96
 97' 
 98
 99'PropertyTextBox 
100
101' 
102
103Me  .PropertyTextBox.Anchor =  CType  (((System.Windows.Forms.AnchorStyles.Bottom  Or  System.Windows.Forms.AnchorStyles.Left) _ 
104
105Or  System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) 
106
107Me  .PropertyTextBox.BackColor = System.Drawing.SystemColors.Info 
108
109Me  .PropertyTextBox.Location =  New  System.Drawing.Point(8, 296) 
110
111Me  .PropertyTextBox.Multiline =  True 
112
113Me  .PropertyTextBox.Name = "PropertyTextBox" 
114
115Me  .PropertyTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both 
116
117Me  .PropertyTextBox.Size =  New  System.Drawing.Size(536, 112) 
118
119Me  .PropertyTextBox.TabIndex = 3 
120
121Me  .PropertyTextBox.Text = "" 
122
123' 
124
125'SavePropertyButton 
126
127' 
128
129Me  .SavePropertyButton.Anchor =  CType  ((System.Windows.Forms.AnchorStyles.Bottom  Or  System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) 
130
131Me  .SavePropertyButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat 
132
133Me  .SavePropertyButton.Location =  New  System.Drawing.Point(320, 240) 
134
135Me  .SavePropertyButton.Name = "SavePropertyButton" 
136
137Me  .SavePropertyButton.Size =  New  System.Drawing.Size(104, 32) 
138
139Me  .SavePropertyButton.TabIndex = 4 
140
141Me  .SavePropertyButton.Text = "  保存样式  " 
142
143' 
144
145'BuildCodeButton 
146
147' 
148
149Me  .BuildCodeButton.Anchor =  CType  ((System.Windows.Forms.AnchorStyles.Bottom  Or  System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) 
150
151Me  .BuildCodeButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat 
152
153Me  .BuildCodeButton.Location =  New  System.Drawing.Point(432, 240) 
154
155Me  .BuildCodeButton.Name = "BuildCodeButton" 
156
157Me  .BuildCodeButton.Size =  New  System.Drawing.Size(104, 32) 
158
159Me  .BuildCodeButton.TabIndex = 5 
160
161Me  .BuildCodeButton.Text = "  生成代码  " 
162
163' 
164
165'Label1 
166
167' 
168
169Me  .Label1.Anchor =  CType  ((System.Windows.Forms.AnchorStyles.Bottom  Or  System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) 
170
171Me  .Label1.Location =  New  System.Drawing.Point(8, 240) 
172
173Me  .Label1.Name = "Label1" 
174
175Me  .Label1.Size =  New  System.Drawing.Size(80, 23) 
176
177Me  .Label1.TabIndex = 6 
178
179Me  .Label1.Text = "  样式选择  :" 
180
181' 
182
183'Label2 
184
185' 
186
187Me  .Label2.Location =  New  System.Drawing.Point(8, 16) 
188
189Me  .Label2.Name = "Label2" 
190
191Me  .Label2.Size =  New  System.Drawing.Size(88, 23) 
192
193Me  .Label2.TabIndex = 7 
194
195Me  .Label2.Text = "  变量框  :" 
196
197' 
198
199'Label3 
200
201' 
202
203Me  .Label3.Location =  New  System.Drawing.Point(192, 16) 
204
205&lt;SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体;</system.diagnostics.debuggerstepthrough()>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus