Click here to Skip to main content
14,661,186 members
Rate this:
Please Sign up or sign in to vote.
See more:
I want to move a window label in label in windows application.
Is it possible, if yes then how?

I have seen it in VB
Posted
Updated 9-Jan-11 13:18pm
v3
Comments
Espen Harlinn 8-Jan-11 7:51am
   
A vote of 1 is the same as telling me that my answer was dead wrong, please explain - I'm somewhat curious ...

Rate this:
Please Sign up or sign in to vote.

Solution 2

Something like this :
A C# Scrolling Text Control[^]

Cheers
   
Comments
Espen Harlinn 8-Jan-11 9:40am
   
5+, I thought Maruee was his girlfriend :) obvious now that spelling ahs bnee crroected ...
Rate this:
Please Sign up or sign in to vote.

Solution 1

Set the label.Left and label.Top properties

Regards
Espen Harlinn
   
v2
Comments
Estys 8-Jan-11 8:07am
   
He wants a marquee-style element.
Espen Harlinn 8-Jan-11 8:57am
   
If that's the case, it was pretty hard to guess from the question ...
Estys 8-Jan-11 9:26am
   
I also read the title : "maruee". My psychic powers insinuated a missing "q" in the middle :). Subsequently I edited the question a sneaked in an answer.
Espen Harlinn 8-Jan-11 9:36am
   
Ahhh, good call, I missed that one :)
fjdiewornncalwe 8-Jan-11 13:12pm
   
I'll +5 it, because your answer is correct based on the question when you answered. It isn't your fault that what he should have been doing was what Estys answered... Cheers.
Espen Harlinn 9-Jan-11 16:45pm
   
Thanks Marcus!
Rate this:
Please Sign up or sign in to vote.

Solution 4

class MarqueeLabel: Label
{
    private int CurrentPosition { get; set; }
    private Timer Timer { get; set; }

    public MarqueeLabel()
    {
        UseCompatibleTextRendering = true;
        Timer = new Timer();
        Timer.Interval = 25;
        Timer.Tick += new EventHandler(Timer_Tick);
        Timer.Start();
    }

    void Timer_Tick(object sender, EventArgs e)
    {
        if (CurrentPosition > Width)
            CurrentPosition = -Width;
        else
            CurrentPosition += 2;

        Invalidate();
    }

    protected override void OnPaint(PaintEventArgs e)
    {
        e.Graphics.TranslateTransform((float)CurrentPosition, 0);
        base.OnPaint(e);
    }

    protected override void Dispose(bool disposing)
    {
        if (disposing)
        {
            if (Timer != null)
                Timer.Dispose();
        }
        Timer = null;
    }
}


Hope it helps...
By Yatheesh Achar Kumble
   
Rate this:
Please Sign up or sign in to vote.

Solution 3

you can navigate this link[^] to know how to create a Label Marquee.
   
Comments
arshad alam 10-Jan-11 5:00am
   
your application is throwing an exception after closing this.. i think your dispose method is not defined properly..
RaviRanjanKr 11-Jan-11 9:24am
   
Oh my God I have not made this Application. I've only refer you a link that might help you.
you can post your query to writer of Article.

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100