Using Dialog Box:

I want to draw a ball in a solid color and be able to move the ball around on the Dialog Box.

Thanks

There's different ways to do this. How do you want to do it? You can do it quickly with dialog wizards or code it from scratch. This sounds like a class assignment. You have to be more specific.

Using Dialog Box:
I want to draw a ball in a solid color and be able to move the ball around on the Dialog Box.

Simplest way I can think of would be to set up a timer and update the coordinates of the ball in it. Call InvalidateRect and UpdateWindow to force an update of the screen.

Override the OnPaint message handler for your dialog. Draw your ball in there using the device context pointer provided.

I think what it seems to me that he wants is to associate the moving object (the ball) with a keyboard or mouse control.

You got too much time on your hands. ;)

Nah, it was good practice. :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.