Code:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class NewsControl : UserControl { String drawString; public NewsControl() { InitializeComponent(); } private void NewsControl_Paint(object sender, PaintEventArgs e) { // Create string to draw. getText(drawString); // Create font and brush. Font drawFont = new Font("Arial", 8); SolidBrush drawBrush = new SolidBrush(Color.Black); // Create point for upper-left corner of drawing. float x = 130.0F; float y = 170.0F; // Set format of string. StringFormat drawFormat = new StringFormat(); drawFormat.FormatFlags = StringFormatFlags.DirectionRightToLeft; // Draw string to screen. e.Graphics.DrawString(drawString, drawFont, drawBrush, x, y, drawFormat); } public void getText(string getText) { drawString = getText; } } }
This just show any text i enter in Form1 for example in form1 constructor i did:
newsControl1.ge tText("Hello");
And when im running my program i see Hello.
But now i want using For loop and timer i want that the word Hello to move inside the control up and go away up then return from down bottom again and foinf up again like a loop and each i add more text it will make new line and the seocnd line will go up after the first one and so on.
And i want it will show the control box borders i mean now i just see a text i need to see some borders box or something so the text wont look like it hang in the air.
You can see here on the right top as the page is loading how it should be how the text is moving up: http://www.ynet.co.il/home/0,7340,L-8,00.html
Thanks for help.
Comment