从API填充组合框

时间:2015-03-18 07:44:15

标签: c# .net

我的解决方案中有两个项目:

  1. API:https://github.com/foxip/mollie-api-csharp
  2. Iretrieve并从我的API发送数据的项目
  3. 我想用methods填充一个ComboBox但是当我尝试按照他们说我应该这样做时,它不起作用。这就是我试过的:

    using Mollie.Api;
    
    // ...
    
    MollieClient mollieClient = new MollieClient();
    mollieClient.setApiKey("test_1234");
    
    Method methods = new Method();
    methods = Mollie.Api.Method.all();
    

    总之,有一条红线说:

      

    错误1'Mollie.Api.Method'不包含'all'的定义

    当我写Mollie.Api.Method.*时,帮助器会在*处给我所有可能的方法,但是如何将它们自动输入到我的ComboBox中?

    编辑:这对我有用: cboMethod.DataSource = Enum.GetNames(typeof(Method));

0 个答案:

没有答案
相关问题