Sep 13, 2014 at 3:27 PM
Edited Sep 13, 2014 at 3:28 PM
i am trying to implement simple marquee using simpletextcontrol

public int XVALUE
        get { return x; }
        set { this.x = value;

    protected override void OnRender(WindowRenderTarget renderTarget)

        string text = "Hello World using  DirectWrite!";
        renderTarget.DrawText(text, this._textFormat,
            new RectF(x, 0, ClientSize.Width, ClientSize.Height),_blackBrush, DrawTextOptions.None, MeasuringMode.Natural);

on mainform i have a timer which ontick event change XVALUE

i am gdi programmar i want to know how to dispose of things as it will keep on increasing memory and app crashes.

this is timer tick event
this.Text = simpleTextControl1.XVALUE.ToString();
        if (simpleTextControl1.XVALUE < 640)
            simpleTextControl1.XVALUE = simpleTextControl1.XVALUE + 5;
            simpleTextControl1.XVALUE = -300; 
Sep 14, 2014 at 9:31 AM
can you please tell how to handle memory properly as there is memory leak.
Sep 25, 2014 at 4:55 PM
You can try sample project Managed.D2DShart.Marquee. Please write if problem with memory leak persists. Don't forget use the latest version of D2DSharp.

Thank you.