From db7cafdbf8f165ee8a7e9ca2d8d864c93809ffb7 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 21 Aug 2018 16:52:37 +0200 Subject: [PATCH] jj: add gui for choice lists --- TestGUI/Form1.Designer.vb | 37 ++++++++++++++++++++++++++++++++++++- TestGUI/Form1.vb | 21 +++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/TestGUI/Form1.Designer.vb b/TestGUI/Form1.Designer.vb index 2122469a..95ad1e2f 100644 --- a/TestGUI/Form1.Designer.vb +++ b/TestGUI/Form1.Designer.vb @@ -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 diff --git a/TestGUI/Form1.vb b/TestGUI/Form1.vb index b4d04de2..0b05bffa 100644 --- a/TestGUI/Form1.vb +++ b/TestGUI/Form1.vb @@ -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