473,472 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Scrollbar on label

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
Nov 16 '05 #1
10 27556
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. ..
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

Nov 16 '05 #2
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. ..
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

Nov 16 '05 #3
> 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.
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


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

Darrell
Nov 16 '05 #4
> For your purpose, i would recommend you richTextBox (non-editable).

That's done the job. Brilliant. I just have one more question though. Is it
possible to get the box to automatically scroll down with the text. At the
moment you have to scroll down manually.

Darrell
Nov 16 '05 #5

Try this

richTextBox1.ScrollToCaret();

--
Shak
(Houston)
"Darrell Blake" <no@spam.com> wrote in message
news:BK*****************@fe1.news.blueyonder.co.uk ...
For your purpose, i would recommend you richTextBox (non-editable).
That's done the job. Brilliant. I just have one more question though. Is

it possible to get the box to automatically scroll down with the text. At the
moment you have to scroll down manually.

Darrell

Nov 16 '05 #6
> richTextBox1.ScrollToCaret();

I've already tried that. It doesn't work. I think it's because there isn't a
caret in the text box. One because it's not editable anyway and two because
what's being entered into the box is the response from the IRC server. It's
not actually user entry.

Darrell
Nov 16 '05 #7
Try this

richTextBox1.Focus();
richTextBox1.SelectionStart = richTextBox1.Text.Length;
richTextBox1.ScrollToCaret();

--
Shak
(Houston)


"Darrell Blake" <no@spam.com> wrote in message
news:N4****************@fe1.news.blueyonder.co.uk. ..
richTextBox1.ScrollToCaret();
I've already tried that. It doesn't work. I think it's because there isn't

a caret in the text box. One because it's not editable anyway and two because what's being entered into the box is the response from the IRC server. It's not actually user entry.

Darrell

Nov 16 '05 #8
It's ok I've solved it. Apparently the HideSelection property of the
RichTextBox has to be set to false.

Darrell
Nov 16 '05 #9
Darrell,

Dynamically Scrolling a textbox as content changes
and lines are appended.

Just use the TextBox.AppendText() method.
Will work.

//--------------------------------
this.vtLog.AppendText("\r\n" + s);
this.vtLog.Update();
//--------------------------------


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #10
Use a TextBox instead of a lable. Then you can use it's ScrollToCaret()
method.
Regards,
Munir Husseini

iCOMcept GmbH

www.icomcept.com


"Darrell Blake" <no@spam.com> schrieb im Newsbeitrag
news:ew****************@fe1.news.blueyonder.co.uk. ..
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

Nov 16 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Marek Mänd | last post by:
<select multiple style="height:200px;"> <option>a <option>b </select> Why does Mozilla draw the vertical scrollbar to the SELECT html element? There is plenty of void room below two OPTIONs in...
22
by: Colin McGuire | last post by:
I apologize for posting yet another scrollbar question. Here is my code. All I want is for a diagonal line to appear from coordinates (0,0) to (width,height) in a usercontrol regardless of whether...
2
by: Simon | last post by:
I've only recently got started using VB.net Compact Framework, and I'm struggling to create a read-only Textbox with a white background. Even though I can set the background colour of a textbox,...
2
by: anx | last post by:
I've got a grid-managed frame, containing a column of Labels, and a corresponding column of Entry widgets. I'd like to be able to display dozens, or even hundreds of rows, and use a vertical...
8
by: Dustan | last post by:
I'm trying to get a scrollbar bound with a Frame, and I keep on getting a scrollbar, but it doesn't actually scroll. Some help, please?
1
by: Jason Huang | last post by:
Hi, In my C# windows form, I have a Label which has many words in it. So I'm thinking using the ScrollBar so I can scroll up and down to see the whole words. Would someone tell me how? Thanks...
3
by: Nebulism | last post by:
Hi everyone, I am working on a module for my GUI that shows one image with an index value below and would use a scrollbar to control which of the images are displayed. The images are stored in a...
1
by: Tom | last post by:
First, I posted a similar request for help in another group and now don't find the posting. Problem with my newsreader perhaps ... but apologies if this appears as a cross posting. My code is...
7
by: Haiyan | last post by:
Dear experts: I am trying to add one xy-scrollbar on the canvas, then put lots of check buttons on the canvas. I got at least following 2 problems: 1.I can see the y-scroll bar but contents on...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.