1、使用vs测试控件
https://www.cnblogs.com/dragon/p/5203663.html
2、如果要引用到foxtable,就引用dll,然后编写代码(实例的全部代码)
项目事件
计划管理
表事件
窗口表事件
窗口与控件事件
窗口3_AfterLoad
e.Form.controls("SplitContainer1").panel1.basecontrol.suspendlayout()
Dim GraphControl1 As new NetronLight.GraphControl
graphControl1.BackColor = System.Drawing.Color.white
graphControl1.Dock = System.Windows.Forms.DockStyle.Fill
graphControl1.Location = new System.Drawing.Point(0, 0)
graphControl1.Name = "graphControl1"
graphControl1.ShowGrid = True
graphControl1.AutoScroll = True
graphControl1.Size = new System.Drawing.Size(442, 614)
graphControl1.TabIndex = 1
graphControl1.Suspendlayout()
e.form.Controls("SplitContainer1").panel1.baseControl.Controls.Add(GraphControl1)
Dim propertyGrid1 As new System.Windows.Forms.PropertyGrid()
propertyGrid1.BackColor = Color.Gainsboro
propertyGrid1.CommandsBackColor = Color.Gainsboro
propertyGrid1.CommandsForeColor = Color.Gray
propertyGrid1.Dock = System.Windows.Forms.DockStyle.Fill
propertyGrid1.HelpBackColor = Color.Gainsboro
propertyGrid1.HelpForeColor = Color.SlateGray
propertyGrid1.LineColor = Color.Gainsboro
propertyGrid1.Location = new System.Drawing.Point(0, 0)
propertyGrid1.Name = "propertyGrid1"
propertyGrid1.Size = new System.Drawing.Size(400, 614)
propertyGrid1.TabIndex = 0
propertyGrid1.ViewForeColor = Color.SlateGray
e.form.Controls("SplitContainer1").panel2.baseControl.Controls.Add(propertyGrid1)
Dim ent As NetronLight.SimpleRectangle
ent = graphControl1.AddShape(0,new Point(200,100))
ent.text = "entity"
ent.Height = 33
ent.ShapeColor = Color.SteelBlue
Dim ent1 As NetronLight.SimpleRectangle
ent1 = graphControl1.AddShape(0,new Point(200,500))
ent1.text = "entity2"
ent1.Height = 33
ent1.ShapeColor = Color.SteelBlue
Dim oval As NetronLight.OvalShape
oval = graphControl1.AddShape(1,new Point(100,300))
oval.Text = "Oval"
oval.Height = 33
oval.ShapeColor = Color.AliceBlue
Dim label As NetronLight.TextLabel
label = graphControl1.AddShape(2, new Point(100,33))
label.Text = "This is the class hierarchy of Netron-Light."
label.Width = 350
label.Height =33
Dim con_n As New NetronLight.Connection()
con_n = graphControl1.AddConnection(ent.Connectors(0), oval.Connectors(3))
con_n.from.name = "shang"
con_n.To.name = "xia"
graphControl1.AddConnection(oval.Connectors(0), ent1.Connectors(3))
Dim p0 As new point
p0.x = 100
p0.y = 100
Dim cp0 As new NetronLight.Connector(p0)
Dim p1 As new point
p1.x = 400
p1.y = 100
Dim cp1 As new NetronLight.Connector(p1)
Dim cpp As new NetronLight.Connector(p1)
cpp.AttachConnector(cp1)
Dim p2 As new point
p2.x = 600
p2.y = 200
Dim cp2 As new NetronLight.Connector(p2)
graphControl1.AddConnection(p0, p1)
graphControl1.AddConnection(p1, p2)
AddHandler graphControl1.click, AddressOf Button1_Click
窗口3_BeforeClose
Dim propertyGrid1 As new System.Windows.Forms.PropertyGrid()
propertyGrid1 = e.form.Controls("SplitContainer1").panel2.baseControl.Controls("propertyGrid1")
propertyGrid1.dispose()
窗口3_SplitContainer1_MouseDown
Dim graphcontrol1 As new NetronLight.GraphControl()
graphControl1 = e.form.Controls("SplitContainer1").panel1.baseControl.Controls("graphControl1")
Dim propertyGrid1 As new System.Windows.Forms.PropertyGrid()
propertyGrid1 = e.form.Controls("SplitContainer1").panel2.baseControl.Controls("propertyGrid1")
Dim ent As object
Dim ent1 As object
ent1 = e.sender
messagebox.show(e.x)
ent = ent1
'For Each ent1 In graphControl1.shapes
'If ent1.Isselected Then
'ent = ent1
'End If
'Next
propertyGrid1.SelectedObject = ent
'propertyGrid1.SelectedObject = new someProperties()
'propertyGrid1.SelectedObject = graphControl1.selectedEntity
'Dim entity1 As NetronLight.Entity
'propertyGrid1.SelectedObject = entity1.selectedEntity
自定义函数
全局代码
Default
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim graphControl1 As new NetronLight.GraphControl()
graphControl1 = Forms("窗口3").Controls("SplitContainer1").panel1.baseControl.Controls("graphControl1")
Dim propertyGrid1 As new System.Windows.Forms.PropertyGrid()
propertyGrid1 = Forms("窗口3").Controls("SplitContainer1").panel2.baseControl.Controls("propertyGrid1")
Dim ent As object
Dim ent1 As object
For Each ent1 In graphControl1.shapes
If ent1.Isselected Then
ent = ent1
propertyGrid1.SelectedObject = ent
ent = Nothing
ent1 = Nothing
End If
Next
For Each ent1 In graphControl1.Connections
If ent1.Isselected Then
ent = ent1
propertyGrid1.SelectedObject = ent
ent = Nothing
ent1 = Nothing
End If
Next
ent = Nothing
ent1 = Nothing
End Sub
菜单事件