如何通过函数传递PictureBox和Label ?
How Do I Pass PictureBox and Label Through Functions?
我在Visual Studio 2012的GUI环境中工作
void dealCard(PictureBox swag, Label swaggy)
{
swag.Image = imageListCards->Images[deck[cardCounter].index];
swaggy.Text = deck[cardCounter].name + " of " + deck[cardCounter].suit + ", " + deck[cardCounter].value;
if(cardCounter == 51)
cardCounter = 0;
else
cardCounter++;
}
void dealHand(PictureBox swag, PictureBox swag2, Label swaggy, Label swaggy2)
{
dealCard(pictureBoxCard4, labelCard4);
dealCard(pictureBoxCard5, labelCard5);
}
pictureBoxCard4, labelCard4等已经在我正在使用的形式。它没有编译部分dealCard(pictureBoxCard4, labelCard4)或下面的
要在函数中传递变量,必须使用指针。
相关文章:
- OpenCV Webcam 源未显示在 PictureBox visual studio 2015 中
- 我想通过imread(opencv)加载后直接在picturebox中显示图像
- 用于为"label"设置值的函数
- 如何在Qt上运行时调整和移动组件(Label、PictureBox)的大小
- 在 switch 语句中使用向量时"Jump to case label"错误。
- 为什么"case::LABEL:"用 g++ 编译?
- Label-BB10本机应用程序中允许的最大Qstring长度
- C++Qt:将TextEdit与Label连接起来
- 如何通过函数传递PictureBox和Label ?
- 我需要文本字段或"Label vs TextField"
- 'goto label'跳过了'unused'的初始化 - 为什么我为 std::string 获取它而不是 int?