While we appreciate comments from our users, please follow our posting guidelines. Have you tried the Cyotek Forums for support from Cyotek and the community?

Styling with Markdown is supported

Original Comment


# Reply

Hi Richard,

First of all, many thanks for your amazing work on this control. It saved me a lot of work, definitely. Though, I facing a little problem... When I make a Graphics object for the underlaying Image, and drawing something on it (lines, for example, or pixels, when the control looses the focus, every line just disappear. Is that a normal behaviour which can be modified with some properties, or what is more probably,do I miss some point... In later case, what can I misunderstood? I do not using any custom painton or so, only catch mouse move ,mouse click and keydown events... (and using DockPanel suite)

Any idea which can point me in right direction?

Thanks in advance,

BR, Lacko


Richard Moss

# Reply


These comments aren't really best placed for support requests, so you may wish to post on our forums, and include sample code if possible. How are you performing the painting? The fact it's happening when the control loses focus would normally strongly suggest that the control is being invalidated, and however you're doing your painting either isn't being called, or is being called in the wrong order.

You said you're creating a Graphics object which I wouldn't have thought you would ever need to do - just tap into the Paint event of the ImageBox (or OnPaint if you have created a custom control) and do your custom painting there. Basically, it sounds like you're doing your custom drawing outside of the ImageBox control's normal paint chain, so when the control is invalidating itself, your own code is unaware that it needs to be redone.

Hope this helps!

Regards; Richard Moss