473,396 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

outflow string

i wrote a code
Expand|Select|Wrap|Line Numbers
  1. public partial class frmFlow : Form
  2.     {
  3.         string FineString = " ";
  4.         PointF thispoint;
  5.         Font thisFont = new Font("Times New Roman", 100);
  6.         SolidBrush thisbrush = new SolidBrush(Color.Red);
  7.  
  8.         public frmFlow()
  9.         {
  10.             InitializeComponent();
  11.         }
  12.  
  13.         private void frmFlow_Load(object sender, EventArgs e)
  14.         {
  15.             SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);
  16.             SetStyle(ControlStyles.ResizeRedraw, true); 
  17.             timer1.Start();
  18.         }
  19.  
  20.         SizeF size = new SizeF();
  21.         RectangleF rc = new RectangleF();
  22.         private void timer1_Tick(object sender, EventArgs e)
  23.         {
  24.             FineString = "(-: Smile :-)";
  25.             timer1.Interval = 33; //(int)nudSpeed.Value; ;
  26.             Invalidate();
  27.         }
  28.         protected PointF getPoint()
  29.         {
  30.             thispoint.X -= 5;//(int)nudDistance.Value; 
  31.             if (thispoint.X <= 0 - size.Width)
  32.             {
  33.                 thispoint.X = this.Width;
  34.             }
  35.             thispoint.Y = 180;
  36.             return thispoint;
  37.         }
  38.  
  39.         private void frmFlow_Paint(object sender, PaintEventArgs e)
  40.         {
  41.             size = e.Graphics.MeasureString(FineString, thisFont);
  42.              e.Graphics.DrawString(FineString, thisFont, thisbrush, getPoint());
  43.         }
  44. }

it's very well but how can i speed it up that it will not look like jumping and look nice so i want to know what to speed up the interval of the timer or to decrease the X point in getpoint or something else
please if you can write a code to do
thank
Jan 17 '10 #1
2 1295
tlhintoq
3,525 Expert 2GB
i want to know what to speed up the interval of the timer
Line 25. Change the .Interval to a smaller number.. Though 33 miliseconds is already fairly quick.

Am I correct in determining that this takes the string "(-: Smile :-)" and scrolls it from right to left in jumps of 5 pixels?
that it will not look like jumping
You could move it in smaller increments than 5 pixels.
Jan 17 '10 #2
you are right the string is scolling from right to left
i need to scroll it very fast for some reasons
thanks again
Jan 17 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: Krakatioison | last post by:
My sites navigation is like this: http://www.newsbackup.com/index.php?n=000000000040900000 , depending on the variable "n" (which is always a number), it will take me anywhere on the site......
5
by: Stu Cazzo | last post by:
I have the following: String myStringArray; String myString = "98 99 100"; I want to split up myString and put it into myStringArray. If I use this: myStringArray = myString.split(" "); it...
9
by: John F Dutcher | last post by:
I use code like the following to retrieve fields from a form: recd = recd.append(string.ljust(form.getfirst("lname",' '),15)) recd.append(string.ljust(form.getfirst("fname",' '),15)) etc.,...
9
by: Derek Hart | last post by:
I wish to execute code from a string. The string will have a function name, which will return a string: Dim a as string a = "MyFunctionName(param1, param2)" I have seen a ton of people...
10
by: Angus Leeming | last post by:
Hello, Could someone explain to me why the Standard conveners chose to typedef std::string rather than derive it from std::basic_string<char, ...>? The result of course is that it is...
37
by: Kevin C | last post by:
Quick Question: StringBuilder is obviously more efficient dealing with string concatenations than the old '+=' method... however, in dealing with relatively large string concatenations (ie,...
2
by: Andrew | last post by:
I have written two classes : a String Class based on the book " C++ in 21 days " and a GenericIpClass listed below : file GenericStringClass.h // Generic String class
2
by: s | last post by:
I'm getting compile errors on the following code: <code> #include <iostream> #include <fstream> #include <list> #include <string> using namespace std;
11
by: Christopher Benson-Manica | last post by:
Let's say I have a std::string, and I want to replace all the ',' characters with " or ", i.e. "A,B,C" -> "A or B or C". Is the following the best way to do it? int idx; while(...
16
by: Steve | last post by:
Hi Guys, I have a string which contains data elements separated by spaces. I also have a function which returns the number of characters from the beginning of the string for a given number of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.