当我单击按钮创建进程时,必须插入“1” 进程列和获取用户键入的大小,然后放入 “Chart1”(条形图形)。 - 我想获取大小并存储在名为“UsedMemory”的变量中并放在图表上。
Me.DataGridView1.Rows.Add("1") 'Add 1 to the first column (idk if it's right).
For i = 0 To 25 Step 1 'populate the Combo with 25 items.
Me.Tamanho.Items.Add(i)
Next
UsedMemory = 'I need the ComboValue here As Integer... and I don't know if I need to set up a default value.
Me.Chart1.Series("Memory").Points.AddXY("Memory", UsedMemory)
答案 0 :(得分:1)
为了便于阅读,首先填充组合框最好(但不是必须)。然后,要检索该值,只需像通常使用任何其他列类型一样进行。
For i = 0 To 25 Step 1 'populate the Combo with 25 items.
Me.Tamanho.Items.Add(i)
Next
Me.DataGridView1.Rows.Add("1", 1) 'the second parameter is the default value the combobox column will have
UsedMemory = Me.DataGridView1.Rows(0).Cells(1).Value '0 or any index you need
Me.Chart1.Series("Memory").Points.AddXY("Memory", UsedMemory)