Problems with start menu

M

Markus Humm

Hello,

we've written some app. in VS2003, VB.net and CF 1.0 to be precise.
The app has one screen where a graph is displayed. This is drawn
directly on the canvas. It works but if the start menu is opened and
closed, part of the graph is missing. The things on that screen which
are objects are redrawn, but not the graph.

We already had a redraw mechanism for the graph depending on some event,
but in the case of the startmenu it simply didn't fire. If fired well
enough if you e.g. got notifications about meetings etc. but not for
startmenu.

Another approach we tried was OnPaint, but this only worked on the
emulator. On the real device it was called way too often. Some idea was
to decide based on the sender object passed to OnPaint whether to redraw
or not, but the programmer couldn't figure out whether reflection works
or not.

What to do with that?

Greetings

Markus
 
G

Guest

You should use the OnPaint for drawing. What do you mean it was called too
often? This event should be raised by the system only in the case if
something caused the screen invalidation or you called Invalidate() method in
the code.
 
M

Markus Humm

Alex said:
You should use the OnPaint for drawing. What do you mean it was called too
often? This event should be raised by the system only in the case if
something caused the screen invalidation or you called Invalidate() method in
the code.

I'll ask my programmer. He says with using OnPaint it's like a endless loop.

Greetings

Markus
 
S

Simon Hart

It might seem like an endless loop while debugging, but as Alex said, it
only gets called when required, for example the start menu is opened.

To reduce flicker try overriding OnPaintBackground().

Simon.
 
M

Markus Humm

Simon said:
It might seem like an endless loop while debugging, but as Alex said, it
only gets called when required, for example the start menu is opened.

To reduce flicker try overriding OnPaintBackground().
Okay we'll try, but afaik my developper did also tests on real pocket
PCs with the same symptoms. What does it trigger as well?

Greetings

Markus
 
M

Markus Humm

Hello,

what we want to do is basically this:

- draw something directly on canvas
- redraw it after opening the start menu and closing it

We've tried the OnPaint event now. When we get it we set some flag and
upon this we redraw our part (no objects, simple lines on the canvas).
But after finishing this (or even while doing this, we don't know
exactly) the OnPaint gets fired again. Why? Because of our redrawing?

What to do now?

Greetings

Markus
 
M

Markus Humm

Hello,

the problem is solved now. There were some panels in between which also
caused OnPaints...

Greetings

Markus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top