Click here to Skip to main content
15,903,743 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
i want text to scroll text in status bar but not able to do!!!actually im picking data from dadtabse n then showing in status bar in scrolling mode but im neither able to show text nor scroll it any suggestions!!
Posted
Updated 8-Jul-10 6:50am
v2
Comments
Sandeep Mewara 8-Jul-10 13:32pm    
status bar as in what? Browser? Your application?
raju melveetilpurayil 8-Jul-10 13:48pm    
if it in browser status bar, for security issue it block by browser itself
mcapatna 9-Jul-10 1:59am    
Reason for my vote of 4
creative idea

I don't know about the status bar in web page. But In windows forms the status bar itself is not sufficient enough to show up the messages. Say if I want to show the message "Process Completed", programmer may write this line - StatusBar.Text = "Process Completed".
But this will not show the message in the UI. What one need to do is add the control Lable to the StatusBar then assign the Text property of the Label - Lable1.Text = "Process Completed".

As far as scrolling text is concerned, you need to change the location (Control.Left Property) of label in the status bar periodically. But this should be done on another thread so that its location syncs with UI. You can do it with BackGroundThreadWorker provided in .Net 3.0. If you are using the older version, you need to do it in a thread created explicitly
 
Share this answer
 
thanks for all replies!!!
i got the answer n its vry simple we can do it by removing first character of the string and add it in the end, continuing this makes string appear in a scrolling manner :-\
I used StringBuilder instead of string

Code Snippet:

on tick event of timer control i wrote following lines;

char ch = sb[1];
sb.remove(1,1);
sb.insert(sb.length,ch);
toolStripLabel.text = sb.tostring();

i declared sb object of System.text.StringBuilder in load function and assign it a text!!!

sb = new StringBuilder(toolStripStatusLabel1.Text + " ");

toolStripStatusLabel1 is the label over status strip

Did this in VS 2008
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900