2015-12-07 30 views
0

我正在做一个交换器应用程序,我需要帮助将我已经放入的文本框和组合框中的货币与另一个文本框中的货币结合起来,当我点击分配/添加按钮时。需要我的应用程序的一些提示

我一直坚持这一点,而现在。

我已经尝试了很多事情,也许我正在过问这个问题。

private void asignBttn_Click(object sender, EventArgs e) 
{ 
    Currency currency1 = valueFromCoBox.SelectedItem as Currency; 

    if (valueFromCoBox.Text == string.Empty) { return; } 

    foreach (var item in resultBox.Text) 
    { 

    } 
+0

您试图从两个不同的来源获取文本并将它们连接到另一个文本框? –

回答

0

我不太明白的是,你从选择框(我不太熟悉的.NET类型)拉动型Currency

但是,如果它是一个自定义类,它会更容易。

private void asignBttn_Click(object sender, EventArgs e) 
{ 
    Currency currency1 = valueFromCoBox.SelectedItem as Currency; 

    if (valueFromCoBox.Text == string.Empty) { return; } 

    //// how about this? 
    resultBox.Text = valueFromCoBox.Text + currency1; 

让我们知道。

+0

为什么你认为'货币'可以与'串'串联? –

+0

因为它会很好,如果它可以:)否则我会工作。 –

相关问题