jj: add gui for choice lists

This commit is contained in:
Jonathan Jenne 2018-08-21 16:52:37 +02:00
parent d7f490d298
commit db7cafdbf8
2 changed files with 57 additions and 1 deletions

View File

@ -37,6 +37,9 @@ Partial Class Form1
Me.Button2 = New System.Windows.Forms.Button()
Me.GridControl1 = New DevExpress.XtraGrid.GridControl()
Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView()
Me.Label5 = New System.Windows.Forms.Label()
Me.Button5 = New System.Windows.Forms.Button()
Me.ComboBox1 = New System.Windows.Forms.ComboBox()
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
@ -170,11 +173,40 @@ Partial Class Form1
Me.GridView1.GridControl = Me.GridControl1
Me.GridView1.Name = "GridView1"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(634, 55)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(61, 13)
Me.Label5.TabIndex = 17
Me.Label5.Text = "Choicelists:"
'
'Button5
'
Me.Button5.Location = New System.Drawing.Point(764, 72)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(75, 23)
Me.Button5.TabIndex = 18
Me.Button5.Text = "Get Items"
Me.Button5.UseVisualStyleBackColor = True
'
'ComboBox1
'
Me.ComboBox1.FormattingEnabled = True
Me.ComboBox1.Location = New System.Drawing.Point(637, 74)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(121, 21)
Me.ComboBox1.TabIndex = 19
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(800, 450)
Me.ClientSize = New System.Drawing.Size(1050, 487)
Me.Controls.Add(Me.ComboBox1)
Me.Controls.Add(Me.Button5)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.GridControl1)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Label4)
@ -214,4 +246,7 @@ Partial Class Form1
Friend WithEvents Button2 As Button
Friend WithEvents GridControl1 As DevExpress.XtraGrid.GridControl
Friend WithEvents GridView1 As DevExpress.XtraGrid.Views.Grid.GridView
Friend WithEvents Label5 As Label
Friend WithEvents Button5 As Button
Friend WithEvents ComboBox1 As ComboBox
End Class

View File

@ -65,4 +65,25 @@ Public Class Form1
GridView1.Columns.Clear()
End If
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Dim items As New List(Of String)
items = _windream.GetChoicelistItems(ComboBox1.Text)
MsgBox("choicelist items:" & vbNewLine & (String.Join(vbNewLine, items.ToArray)))
End Sub
Private Sub ComboBox1_Click(sender As Object, e As EventArgs) Handles ComboBox1.Click
Dim lists = _windream.GetChoiceLists()
ComboBox1.Items.Clear()
For Each list As String In lists
ComboBox1.Items.Add(list)
Next
ComboBox1.DroppedDown = True
End Sub
End Class