hi,
i am currently working with forms.i hav created a login page ,administrator page form and one more form.i want a text to be flying(scrolling) in the 3rd form and it must be updated from the administrator page form.how shall i do??????????
kindly suggest me!!!!!!!!!!
Loading

theLizardRank #1,079 · 1.8K reputationPosted Jan 9, 2010, 10:18 PM EST
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
string marqueeText = "private void button1_Click(object sender, EventArgs e)";
float posX = 0.0f;
int pos = 0;
string marquee = "";
System.Drawing.Graphics formGraphics = null;
System.Drawing.Font drawFont = new System.Drawing.Font("Tahoma", 16);
System.Drawing.SolidBrush drawBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
posX = this.Width;
formGraphics = this.CreateGraphics();
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
if (pos != marqueeText.Length)
{
marquee += marqueeText[pos];
DrawString(marquee, posX );
posX--;
pos++;
}
else
{
if (marquee.Length > this.Width + 1)
marquee = marquee.Substring(1);
marquee += " ------ ";
pos = 0;
}
if (posX == 0.0f)
{
pos = 0;
}
}
private void DrawString(string s, float pos)
{
float x = pos;
float y = 50.0f;
formGraphics.Clear(this.BackColor);
formGraphics.DrawString(s, drawFont, drawBrush, x, y);
//drawFont.Dispose();
//drawBrush.Dispose();
//formGraphics.Dispose();
}
}
}
Sam HobbsRank #107 · 20.5K reputationPosted Jan 8, 2010, 9:19 PM EST
Please do make your questions bigger with more details. You need to provide details such as the type of project; is this a web form or a desktop form?
dhilipan nair17 reputationPosted Jan 9, 2010, 4:25 AM EST
i am currently using 3 forms.
1)login form2)administator page3)a form to register attendance.
i want important news to be scrolling in the 3rd form,whenever it is loaded.and that text must be updatable by the 2nd form.
dhilipan nair17 reputationPosted Jan 9, 2010, 4:26 AM EST
i am currently using 3 forms.
1)login form2)administator page3)a form to register attendance.
i want important news to be scrolling in the 3rd form,whenever it is loaded.and that text must be updatable by the 2nd form.
Sam HobbsRank #107 · 20.5K reputationPosted Jan 9, 2010, 9:52 AM EST
Th reason I ask if it is a desktop application is because there is a marquee control for HTML that probably does what you need to do.
If you search for marquee then you will find articles and such.
Sam HobbsRank #107 · 20.5K reputationPosted Jan 9, 2010, 6:14 PM EST
dhilipan nair17 reputationPosted Jan 10, 2010, 2:09 AM EST
Sam HobbsRank #107 · 20.5K reputationPosted Jan 13, 2010, 9:44 AM EST
theLizardRank #1,079 · 1.8K reputationPosted Jan 14, 2010, 6:38 PM EST
Features:
Get and Set for;
MarqueeText
ScrollEnabled
ScrollTextColor
Shadow
ShadowColor
ShadowOffsetX
ShadowOffsetY
plus
Font size and font family changed
Auto re size of user control on font size change
:)