【问题标题】:How to print on windows form application label如何在 Windows 窗体应用程序标签上打印
【发布时间】:2019-09-22 22:58:50
【问题描述】:

如何在c++中windows窗体应用的label中打印节点数据(即:curr->room)

我的节点包含字符串的“时间”和“房间”变量

    bool found = false;
    node* curr = l.first;

    while (curr != 0)
    {
        if (curr->course == "$")
        {
            found = true;

                cout << "Time: " << curr->time << endl;
            cout << "Room: " << curr->room << endl;
            cout << endl;
        }
        curr = curr->next;
    }
    if (found == false)
        out->Text = "No Free Slots Found!";

}

【问题讨论】:

    标签: c++ winforms user-interface


    【解决方案1】:

    您需要向我们提供有关您的应用程序的更多信息,以便能够为您提供适当的帮助。

    在 Winforms 中,Label 控件与大多数其他类型一样具有 Text 属性。要在标签中显示您的节点数据,请创建一个字符串并将标签的文本设置为该字符串:

    myLabel.Text = string.Format("Time: {0}  Room: {1}", curr->time, curr->room);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-11
      • 1970-01-01
      相关资源
      最近更新 更多