数组到ListBox的转换

时间:2016-02-23 15:57:14

标签: arrays vba listbox

我有一个包含5个数字的整数数组。我想将这些数字复制到ListBox,并使用以下代码。 ListBox1位于UserForm

ListBox1.AddItem (SampleArray(i).tostring)

我收到了这个错误:

  

编译错误:无效的限定符

1 个答案:

答案 0 :(得分:1)

您需要循环并单独添加每个项目

SampleArray(i)

错误是因为ToString是一个整数类型,它没有实现@FXML protected void onCancel(ActionEvent event) { event.consume(); Alert alert = new Alert(AlertType.CONFIRMATION); alert.setTitle("Cancel wizard"); alert.setHeaderText("Are you sure you wish to cancel this wizard ?"); alert.setContentText("Choose your option."); ButtonType buttonTypeYes = new ButtonType("Yes", ButtonData.YES); ButtonType buttonTypeNo = new ButtonType("No", ButtonData.NO); alert.getButtonTypes().setAll(buttonTypeYes, buttonTypeNo); Optional<ButtonType> result = alert.showAndWait(); if (result.get() == buttonTypeYes) { getSkinnable().cancel(); } } 方法 - 基本VBA中没有任何东西(不要将它与VB.Net混淆)。