将文本附加到标签 [英] Append Text To Label
问题描述
foreach(sca中的字符串s)
{
lblProgress.Visible = true;
lblProgress.ForeColor = System.Drawing.Color.Black;
lblProgress.Font = new Font(lblNoData。 Font.Name,10,FontStyle.Bold);
lblProgress.Text =" Now Working On Customer" + s;
}
我希望标签自动扩展以阅读
现在正在处理客户1
现在正在处理客户2
现在为客户3工作¥b $ b 现在开始工作客户4
如果它填满了屏幕,请添加一个滚动条,以便用户可以向上/向下滚动以查看客户已处理/未处理的内容
foreach (string s in sca)
{
lblProgress.Visible = true;
lblProgress.ForeColor = System.Drawing.Color.Black;
lblProgress.Font = new Font(lblNoData.Font.Name, 10, FontStyle.Bold);
lblProgress.Text = "Now Working On Customer " + s;
}
I want the label to auto-expand to read
Now Working on Customer 1
Now Working on Customer 2
Now Working on Customer 3
Now Working on Customer 4
and if it fills the screen, add a scrollbar so the user can scroll up/down to see what customer has/has not been processed
推荐答案
by ItemsControl 条目动态扩展。
by ItemsControl entries are dynamically extended.
可以有关联ItemsSource或项目直接生成的项目:
There can be items generated by associate ItemsSource or items direct:
---------------------- snippet ----------------------- --------
---------------------- snippet -------------------------------
& NBSP;&NBSP;&NBSP; < ListBox>
< ListBoxItem>现在正在处理客户1< / ListBoxItem>
< ListBoxItem>正在处理客户2< / ListBoxItem>
< ListBoxItem>现在正在处理客户3< / ListBoxItem>
< ListBoxItem>现在正在处理客户4< / ListBoxItem>
< / ListBox>
<ListBox>
<ListBoxItem>Now Working on Customer 1</ListBoxItem>
<ListBoxItem>Now Working on Customer 2</ListBoxItem>
<ListBoxItem>Now Working on Customer 3</ListBoxItem>
<ListBoxItem>Now Working on Customer 4</ListBoxItem>
</ListBox>
---------------------------------- -------------------------
-----------------------------------------------------------
问候,Hubert Hermanutz
regards, Hubert Hermanutz
这篇关于将文本附加到标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!