标签上的滚动条 [英] Scrollbar on label

查看:116
本文介绍了标签上的滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个IRC客户端来自学C#并遇到一个小的问题。我正在使用一个标签来显示所有文本,当文本到达时,标签的底部不会自动向下滚动,因此你不能

查看新消息。如果可能的话,我想做两件事之一。要么

标签要自动向下滚动或添加滚动条。最好是,我想要两个都有,因为这样可以看到之前的

消息。


有谁知道如果这些是可能的并指出我正确的方向?


Darrell

I''m writing an IRC client to teach myself C# and have run into a small
problem. I''m using a label to display all the text and when the text gets to
the bottom of the label it doesn''t automatically scroll down so you can''t
see the new messages. I want to do one of two things if possible. Either get
the label to automatically scroll down or add a scroll bar. Preferably, I
would like to have both because then it would be possible to see previous
messages.

Does anyone know if these are possible and point me in the right direction?

Darrell

推荐答案

你可能想要尝试在标签上使用AutoSize,在一个可滚动的容器(如面板)中放置

,并设置AutoScroll

属性。我想象一下这里的一些问题标签不仅要垂直向下延伸

,而且还要在水平方向偏离右侧,这可能会导致

a问题。

-

贾斯汀罗杰斯

DigiTec Web Consultants,LLC。

博客: http://weblogs.asp.net/justin_rogers

" Darrell Blake" < no@spam.com>在消息中写道

新闻:ew **************** @ fe1.news.blueyonder.co.uk。 ..
You might want to try playing around with AutoSize on the label placing
it inside of a scrollable container such as a panel, and setting the AutoScroll
property. I am envisioning some issues here with the label not just extending
vertically down, but also horizontally off the right side which might just cause
a problem.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Darrell Blake" <no@spam.com> wrote in message
news:ew****************@fe1.news.blueyonder.co.uk. ..
我正在写一个IRC客户端来自学C#并遇到一个小问题。我正在使用标签显示所有文本,当文本到达标签的底部时,它不会自动向下滚动,因此您无法查看新消息。如果可能的话,我想做两件事之一。要么使标签自动向下滚动或添加滚动条。最好是,我希望两者都有,因为这样可以看到以前的消息。

有谁知道这些是否可能并指出我正确的方向?

Darrell
I''m writing an IRC client to teach myself C# and have run into a small
problem. I''m using a label to display all the text and when the text gets to
the bottom of the label it doesn''t automatically scroll down so you can''t
see the new messages. I want to do one of two things if possible. Either get
the label to automatically scroll down or add a scroll bar. Preferably, I
would like to have both because then it would be possible to see previous
messages.

Does anyone know if these are possible and point me in the right direction?

Darrell



Darell,


为了您的目的,我会推荐你​​richTextBox(不可编辑)。它带有两个方向的滚动条(Horz和Vert),并且它有更多的功能来支持
。你甚至可以为文本上色。


Label不是一个可滚动的控件,如果你可以模拟所有的功能,添加一个外部滚动条将是很好的b / b
滚动条。


-

Shak

(休斯顿)



Darrell Blake < no@spam.com>在消息中写道

新闻:ew **************** @ fe1.news.blueyonder.co.uk。 ..
Darell,

For your purpose, i would recommend you richTextBox (non-editable). It comes
with scrollbars both ways (Horz and Vert) and it has lot more functions to
take advantage of. You can even color the text.

Label is not a scrollable control, and adding a external scrollbar would be
nice, if you can simulate all the functionalities of scrollbar.

--
Shak
(Houston)


"Darrell Blake" <no@spam.com> wrote in message
news:ew****************@fe1.news.blueyonder.co.uk. ..
我正在写一个IRC客户端来自学C#并遇到一个小问题。我正在使用标签显示所有文本,当文本获得
到标签底部时,它不会自动向下滚动,因此您无法查看新消息。如果可能的话,我想做两件事之一。
获取标签以自动向下滚动或添加滚动条。最好是,我希望两者都有,因为这样就可以看到以前的消息了。

有谁知道这些是否可行,并指出我在正确的
方向?
Darrell
I''m writing an IRC client to teach myself C# and have run into a small
problem. I''m using a label to display all the text and when the text gets to the bottom of the label it doesn''t automatically scroll down so you can''t
see the new messages. I want to do one of two things if possible. Either get the label to automatically scroll down or add a scroll bar. Preferably, I
would like to have both because then it would be possible to see previous
messages.

Does anyone know if these are possible and point me in the right direction?
Darrell



>您可能想尝试在标签上使用AutoSize,将
> You might want to try playing around with AutoSize on the label placing
放置在可滚动容器(如面板)内,并设置
AutoScroll属性。


因此标签只是在文本发生变化时调整大小?对我来说,这似乎并没有真正有效。也许我选择了错误的工具来显示文字。

除了标签之外还有什么更有效的吗?

我想到的标签不仅仅是垂直向下延伸,还有水平偏离右侧
it inside of a scrollable container such as a panel, and setting the AutoScroll property.
So that the label just resizes as the text goes down? It doesn''t seem really
efficient to me. Maybe I''ve chosen the wrong tool to display the text. Is
there anything other than a label which would be more efficient?
I am envisioning some issues here with the label not just extending
vertically down, but also horizontally off the right side




目前文本包围所以这可能不是问题。


Darrell



At the moment the text wraps round so this might not be a problem.

Darrell


这篇关于标签上的滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆